modulepreload does not use CDN url
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v17.8.0
- Nuxt Version:
3.0.0-27470397.9ebea90
- Package Manager:
yarn@1.22.18
- Builder:
vite
- User Config:
vue
,vite
,css
,app
,publicRuntimeConfig
,build
,buildModules
,modern
,hooks
,meta
- Runtime Modules:
-
- Build Modules:
@pinia/nuxt@0.1.8
Reproduction
- Define a CDN url via e.g. NUXT_APP_CDN_URL
- Run
server/index.mjs
in production mode - Look for
<link "modulepreload"...>
There should be redundant entries: One with just a path and one with the correct CDN url - Note: The incorrect tags are injected on client side; SSR renders the correct urls
Describe the bug
If a CDN url is defined, <link>
tags with modulepreload
will be injected into <head>
that wont have the CDN url prefixed. This happens on the client resulting in duplicated link tags: with and without CDN url. The actual import uses the correct url though.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Resource Hints: modulepreload | Can I use... Support tables ...
"Can I use" provides up-to-date browser support tables for support of front-end web technologies on desktop and mobile web browsers.
Read more >Link types: modulepreload - HTML - MDN Web Docs - Mozilla
The modulepreload keyword for the rel attribute of the <link> element provides a declarative way to preemptively fetch a module script and its ......
Read more >Preload, prefetch and other <link> tags
Don't use <link rel="preload"> if you don't need a resource immediately after the page loads. If you only need it later – e.g.,...
Read more >ES Module Preloading & Integrity - Guy Bedford
A major issue with using modulepreload as the primary integrity approach is there is no easy way to provide integrity upfront for lazy...
Read more >Is it possible to use subresource integrity with ES6 module ...
From an HTML document, you can use the <link rel="modulepreload"> ... Please note, SRI doesn't address the sources (whether a URL, CDN, npm, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issues has been fixed with RC-3. Thanks a lot!
@ErickLuis00 Would you open a new issue with a reproduction?
Actually, seems there already is one: https://github.com/nuxt/framework/issues/6586