Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 364 forks source link

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

Closed ericanafziger closed 4 years ago

ericanafziger commented 4 years ago

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.

jaredkc commented 4 years ago

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.

ericanafziger commented 4 years ago

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

fbushell commented 4 years ago

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[bot] commented 4 years ago

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.