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

AssetPreload should lint only 1st party assets #693

Open
nickbabcock opened this issue Dec 21, 2022 · 0 comments
Open

AssetPreload should lint only 1st party assets #693

nickbabcock opened this issue Dec 21, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@nickbabcock
Copy link

Describe the bug

The AssetPreload lint fires on the following line:

<link rel="preload" as="script" href="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js">

If we take the suggestion and preload this 3rd party asset with the preload_tag

{{ 'https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js' | preload_tag: as: 'script' }}

Shopify will return the following liquid error on page load:

Liquid error: Input must be a theme or shop asset URL. 

Expected

I expected that either the preload_tag would work with 3rd party assets or that the AssetPreload wouldn't give a false positive that leads to a liquid error.

Additional context

theme-check --version
1.12.1
@nickbabcock nickbabcock added the bug Something isn't working label Dec 21, 2022
eloyesp added a commit to eloyesp/theme-check that referenced this issue Feb 23, 2023
Prevent suggesting the usage of preload_tag for third party assets.

Fixes Shopify#693.
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