JS assets are pulling twice when use app.cdnURL
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v16.14.0
- Nuxt Version:
3.0.0-rc.1-27515112.2d202b5
- Package Manager:
yarn@1.22.18
- Builder:
vite
- User Config:
components
,autoImports
,plugins
,runtimeConfig
,buildModules
,modules
,app
,partytown
,intlify
,build
,nitro
,css
,serverMiddleware
,hooks
- Runtime Modules:
@nuxtjs/partytown@1.1.2
- Build Modules:
@pinia/nuxt@0.1.8
,@intlify/nuxt3@0.1.10
Reproduction
export default defineNuxtConfig({
// nuxtApp configuration
app: {
cdnURL: 'CDN_BASE_URL'
}
})
Describe the bug
When we use cdnURL
option it is calling js file twice one from CDN and another one from app root
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Adding and Leveraging a CDN on Your Website | CSS-Tricks
Your CDN URL is the URL all of your assets will point to once things have been set up. A good rule of...
Read more >How to Speed Up WordPress Asset Delivery ... - DigitalOcean
With the Assets Pull addon, it can identify assets (CSS, JS, images, etc) used by your site (for example by WordPress themes) and...
Read more >Deployment race condition causing CDN to cache old or ...
As a general rule of thumb: Don't do live upgrades. (unless the language supports it, but even then think twice). Pulling code using...
Read more >Setup Discourse with KeyCDN - sysadmin
Create a Pull Zone within the KeyCDN dashboard and enter the origin url of your Discourse instance. · Update your app. · Rebuild...
Read more >8th Wall Documentation
Built entirely using standards-compliant JavaScript and WebGL, 8th Wall Web ... 8th Wall works within iOS 13 apps that use SFSafariViewController web views....
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
@danielroe Able to reproduce the issue here https://github.com/anish2690/nuxt3-cdn-url-issue
When you have a SFC under layout (with imports) this issue can be reproducible on run time.
Glad you managed to reproduce it, I was about to try to make a reproduction myself.
FWIW, this seems to be a critical everything-breaking bug if the app url cannot serve those files, and the cdn must be used.
My prod setup: user connects to Wordpress site, which connects to static js site for SSR. SSR is delivered as part of Wordpress render, and shows correctly. The browser then attempts to load the the js - and it must use the CDN url, because the app url is the Wordpress site which doesn’t have those files - so an mjs file gets a 404. The incorrect loading then breaks the javascript on the page.
This setup worked as of
3.0.0-27386975.6e06d2b
, haven’t narrowed it down further at this stage.Edit: I guess the breaking issue is technically #3932 but as you mentioned above they are likely the same issue.