Shopify/slate

Unclosed Statement in {{ content_for_header }} causing errors with start and watch commands

ericanafziger opened this issue · 4 comments

Problem

When running slate-tools start or slate-tools watch, a large unformatted block of code appears at the top of the site above the rest of the page. In the console there is an error Uncaught SyntaxError: missing ) after argument list.

Replication steps

  1. Run slate-tools start or slate-tools watch
  2. Once files are uploaded you will see the error at the top of the screen
  3. This does not appear to happen on slate-tools deploy

image

More Information

From what I can tell this issue is coming from the {{ content_for_header }} code in the theme.liquid file. Everything in here is being injected from Shopify and does not appear to be editable.

I am having the same issue. Currently, I have @shopify/slate-tools: 1.0.0-beta.15, going to update to beta.19 now add see if that helps.

Updating to beta.19 looks like it resolved the issue on my end. Thanks @jaredkc.

I was seeing this as well in 1.0.0-beta.15 and I found a temp solution here.

Add this code in node_modules/@Shopify/slate-tools/tools/dev-server/index.js within the bsConfig function

snippetOptions: {
        rule: {
            match: /<head[^>]*>/i,
            fn: function(snippet, match) {
                return match + snippet;
            }
        }
    }
lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.