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]: Static assets not loaded after pushing to shopify #168

Open
1 task done
soggie opened this issue Aug 8, 2022 · 1 comment
Open
1 task done

[Bug]: Static assets not loaded after pushing to shopify #168

soggie opened this issue Aug 8, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@soggie
Copy link

soggie commented Aug 8, 2022

Operating system

Ubuntu

Node.js version

16

Shopify CLI version

2.18

Browsers

Chrome

Version

4 (Current)

Modifications

No response

Details

  1. Put a few image files (e.g. test.static.png) in the /shopify/assets directory
  2. Create a page, and use them as a normal asset like: <img src="/assets/test.static.png">, or within a vue component
  3. Test on local with shopify theme serve, verify that it works
  4. Push to shopify
  5. View it on live shopify, verify that it doesn't show up. Expectations: image shows up on both local and production

Notice

  • I read the notice
@soggie soggie added the bug Something isn't working label Aug 8, 2022
@TomJacobsUK
Copy link

Are you accounting for the Shopify CDN?

Normally assets on shopify would be loaded via <img src="{{ 'test.static.png' | asset_url }}" /> or {{ 'test.static.png' | asset_url | img_tag: 'test' }} in a liquid template.

With the Vue component, you may need to reference the file relatively instead of absolute (Untested).

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

2 participants