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

Warn if mime type is not CSS #258

Merged
merged 3 commits into from
Oct 14, 2024
Merged

Warn if mime type is not CSS #258

merged 3 commits into from
Oct 14, 2024

Conversation

jamesnw
Copy link
Contributor

@jamesnw jamesnw commented Oct 11, 2024

Description

If a <link> fails to load, we should recover gracefully. This may be because it's a 404 or because it's being loaded as CSS-in-JS for HMR. It possibly is due to a misconfigured server. Ideally we would confirm if it's actually CSS instead of just relying on mimetype, but there's not a good way of checking that.

Related Issue(s)

#255

Steps to test/reproduce

  • Load the demo in a polyfilled browser, see that fake.css fails to load initially.
  • Apply the polyfill.
  • See that the polyfill applies successfully
  • A console warning shows what the error is

Show me

https://deploy-preview-258--anchor-polyfill.netlify.app/

Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for anchor-polyfill ready!

Name Link
🔨 Latest commit a199f0f
🔍 Latest deploy log https://app.netlify.com/sites/anchor-polyfill/deploys/670d3a8c6bf4ee0008f8d3ca
😎 Deploy Preview https://deploy-preview-258--anchor-polyfill.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Oct 11, 2024

Deploy Preview for anchor-position-wpt canceled.

Name Link
🔨 Latest commit a199f0f
🔍 Latest deploy log https://app.netlify.com/sites/anchor-position-wpt/deploys/670d3a8c4be7390008527819

index.html Outdated Show resolved Hide resolved
Co-authored-by: Jonny Gerig Meyer <[email protected]>
@jamesnw jamesnw merged commit 919b7c4 into main Oct 14, 2024
12 checks passed
@jamesnw jamesnw deleted the non-css-link branch October 14, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Polyfill fails if a <link> fails to load or returns non-CSS content
2 participants