Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

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

Merged
merged 4 commits into from
Jul 29, 2022

Conversation

danielroe
Copy link
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.

@danielroe danielroe 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 pi0 July 29, 2022 12:21
@danielroe danielroe self-assigned this Jul 29, 2022
@netlify
Copy link

netlify bot commented Jul 29, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 910ce3b
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62e3d75f8b0ea9000964a68b

@pi0
Copy link
Member

pi0 commented Jul 29, 2022

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
Member Author

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?)

test/utils.ts Show resolved Hide resolved
@pi0
Copy link
Member

pi0 commented Jul 29, 2022

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
Member Author

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

@pi0
Copy link
Member

pi0 commented Jul 29, 2022

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

I believe could be in manifest.

@danielroe
Copy link
Member Author

test/utils.ts Outdated Show resolved Hide resolved
@pi0 pi0 merged commit 8b5159f into main Jul 29, 2022
@pi0 pi0 deleted the fix/test-utils-warnings branch July 29, 2022 12:50
@pi0 pi0 mentioned this pull request Aug 5, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf webpack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants