Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: blank screen when you have vanilla javascript #164

Open
1 task done
tentree-development opened this issue Jun 16, 2022 · 5 comments
Open
1 task done

[Bug]: blank screen when you have vanilla javascript #164

tentree-development opened this issue Jun 16, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@tentree-development
Copy link

Operating system

os x

Node.js version

17.6.0

Shopify CLI version

2.11.2

Browsers

Chrome

Version

4 (Current)

Modifications

No response

Details

  1. I am developing shopify store based os2.0 with uicrook.
  2. When I have javascript some vanilla javascript in the page template and I get the blank screen
  3. when I run into issue I have something like this and only happens when I push to shopify it works nicely in the local environment.
  4. I want to find out if I use uicrook vannila javascript is not allowed in the .*liquid file?
Uncaught SyntaxError: 60
    at Yo (bundle.js?v=174704609598485302911655352976:68:540697)
    at Pf (bundle.js?v=174704609598485302911655352976:68:584847)
    at Array.Af (bundle.js?v=174704609598485302911655352976:68:585222)
    at su (bundle.js?v=174704609598485302911655352976:68:559818)
    at bundle.js?v=174704609598485302911655352976:68:560222
    at su (bundle.js?v=174704609598485302911655352976:68:560232)
    at bundle.js?v=174704609598485302911655352976:68:560222
    at su (bundle.js?v=174704609598485302911655352976:68:560232)
    at bundle.js?v=174704609598485302911655352976:68:560222
    at su (bundle.js?v=174704609598485302911655352976:68:560232)

Notice

  • I read the notice
@tentree-development tentree-development added the bug Something isn't working label Jun 16, 2022
@pstinnett
Copy link

I was similarly scratching my head at the same thing this morning and found: laravel-mix/laravel-mix#3112

Essentially, a <script></script> tag inside a Vue app causing the same issue. In my case, I was able to move the in template vanilla JS out of the #app container and things worked fine.

@sergejcodes
Copy link
Contributor

Instead of writing the vanilla <script></script> tag inside the Vue app you should be able to use <component is="script"></component> tag and place your JS Code in there

<div id="app">
  <component is="style">
    ...
  <componet>

  <component is="script">
    ...
  </componet>
</div>

@sk29110
Copy link

sk29110 commented Jun 24, 2022

I will try. I also have a problem with shopify app using google map and yotpo royalty app. It provides javascript object however it's javascript object doesn't allow me to call functions in strict mode. Do you have solution to this?

@n-va
Copy link

n-va commented Sep 27, 2022

Would really love a fix for this as there are various Shopify apps that inject script tags, for which there's not really a work around.

@lexthor
Copy link

lexthor commented Jun 5, 2024

any update on this? a lot of apps are using the <script> or <style> in their templates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants