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] Style-tags.liquid not loading product.css #118

Open
qedric opened this issue Jul 6, 2021 · 0 comments
Open

[BUG] Style-tags.liquid not loading product.css #118

qedric opened this issue Jul 6, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@qedric
Copy link

qedric commented Jul 6, 2021

Describe the bug

I just upgraded to version 2.2 of shopify packer (from version 2.1.9 I think) Somehow the upgrade has caused the following issue:

I have a product template, and also a product.bundle template. The styles for the bundle tempate are loading fine:

 {%- if template == 'product.bundle' -%}
<link type="text/css" href="{{ '[email protected]' | asset_url }}" rel="stylesheet">
{%- else -%}
<link rel="prefetch" href="{{ '[email protected]' | asset_url }}" as="style">
{%- endif -%}

however, there is no if statement for just the product bundle alone, and when I look in the /assets folder I see that there is no template.product.css, only the [email protected] shown above.

My templates/product.js and templates/product.bundle.js are almost identical, and both import the same .scss file.

I found another curious thing. When I looked at my old dist folder from previous version of shopify packer, I see the following:

{%- if template == 'page.testimonials' -%}
<link type="text/css" href="{{ 'template.page.testimonials.css' | asset_url }}" rel="stylesheet">
{%- else -%}
<link rel="prefetch" href="{{ 'template.page.testimonials.css' | asset_url }}" as="style">
{%- endif -%} 
**<link type="text/css" href="{{ '[email protected]' | asset_url }}" rel="stylesheet">**
{%- if layout == 'theme' -%}
<link type="text/css" href="{{ 'layout.theme.styleLiquid.css' | asset_url }}" rel="stylesheet">
{%- else -%}
<link rel="prefetch" href="{{ 'layout.theme.styleLiquid.css' | asset_url }}" as="style">
{%- endif -%}

So before it was working, but ONLY because the product style was being loaded on EVERY page!!

Can you tell me what's going wrong, what I need to change? Thanks!

Expected behavior
The css for the default product template should load. it should be wrapped in a liquid condition .

Screenshots
If applicable, add screenshots to help explain your problem.

System (please complete the following information):

  • OS: Windows 10
  • Browser [chrome]

Packer (please complete the following information):

  • Version [e.g. 2.2.0

Theme (please complete the following information):

  • custom
@qedric qedric added the bug Something isn't working label Jul 6, 2021
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

1 participant