Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

fix(webpack): output .mjs to use crossorigin preloads - #6232

Merged
pi0 merged 4 commits into
mainfrom
fix/test-utils-warnings
Jul 29, 2022
Merged

fix(webpack): output .mjs to use crossorigin preloads#6232
pi0 merged 4 commits into
mainfrom
fix/test-utils-warnings

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

We are outputting .js files for webpack, which means we also don't add the crossorigin attribute when rendering. Because of a typo in our tests we weren't pick up on this.

Bug shows up with following warnings (+ double fetches of all webpack JS assets):

A preload for 'http://localhost:3000/_nuxt/59e3a34.js' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
The resource http://localhost:3000/_nuxt/59e3a34.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate `as` value and it is preloaded intentionally.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroedanielroe added bug Something isn't working webpack ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf labels Jul 29, 2022
@danielroe
danielroe requested a review from pi0July 29, 2022 12:21
@danielroedanielroe self-assigned this Jul 29, 2022
@netlify

netlifyBot commented Jul 29, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit910ce3b
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62e3d75f8b0ea9000964a68b

@pi0

pi0 commented Jul 29, 2022

Copy link
Copy Markdown
Member

Would it be fixed with upcoming vue-bundle-renderer? At some point we have to switch back to .js for client module assets. Considering CDN mime support.

@danielroe

Copy link
Copy Markdown
MemberAuthor

No, the vue-bundle-renderer PR doesn't change this behaviour when rendering crossorigin attribute. (We can change it there to default to module - do you think that's a better option?)

Comment threadtest/utils.ts
@pi0

pi0 commented Jul 29, 2022

Copy link
Copy Markdown
Member

This PR seems good to go until we do this but yes I think it is a viable option to support type:module instead of depending on extension for module detection if possible.

@danielroe

Copy link
Copy Markdown
MemberAuthor

As a top-level option to createRenderer (defaulting to true)?

@pi0

pi0 commented Jul 29, 2022

Copy link
Copy Markdown
Member

As a top-level option to createRenderer (defaulting to true)?

I believe could be in manifest.

@danielroe

Copy link
Copy Markdown
MemberAuthor

Comment threadtest/utils.ts Outdated
pi0
pi0 approved these changes Jul 29, 2022
@pi0
pi0 merged commit 8b5159f into mainJul 29, 2022
@pi0
pi0 deleted the fix/test-utils-warnings branch July 29, 2022 12:50
@pi0pi0 mentioned this pull request Aug 5, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't working❗ p4-importantPriority 4: bugs that violate documented behavior, or significantly impact perfwebpack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@danielroe@pi0