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

fix(nitro): respect app.cdnURL when set#2249

Closed
danielroe wants to merge 3 commits intomainfrom
fix/nitro-cdn
Closed

fix(nitro): respect app.cdnURL when set#2249
danielroe wants to merge 3 commits intomainfrom
fix/nitro-cdn

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

resolves nuxt/nuxt#12612
resolves nuxt/nuxt#12922

❓ 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

cdnURL wasn't being taken into account by bundle-renderer. In addition, when serving static files from / we were never allowing a fallback to rendering the vue app. I don't think it's safe simply to disable serveStatic when a CDN is in use, but I would certainly suggest to users that they disable serving static files when using a CDN that does not rely on 'pulling' files from their site:

import { defineNuxtConfig } from 'nuxt3'

export default defineNuxtConfig({
  nitro: {
    serveStatic: false
  }
})

Note: We didn't reserve .app namespace in Nuxt 2 (see nuxt/nuxt#9075) in case it's in use so we need to check ._app existence first.

📝 Checklist

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

@danielroe danielroe added bug Something isn't working nitro labels Dec 1, 2021
@danielroe danielroe requested a review from pi0 December 1, 2021 12:56
@danielroe danielroe self-assigned this Dec 1, 2021
@netlify
Copy link
Copy Markdown

netlify bot commented Dec 1, 2021

✔️ Deploy Preview for nuxt3-docs canceled.

🔨 Explore the source changes: 0167964

🔍 Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/61a8ad8ac715e0000815e973

Comment thread packages/bridge/src/vite/manifest.ts
Comment thread packages/nitro/src/runtime/server/static.ts Outdated
@danielroe danielroe requested a review from pi0 December 6, 2021 11:42
@webfansplz
Copy link
Copy Markdown
Contributor

Hi, may i ask the progress of this PR ? It's so helpful for me , Thanks 😊

@newbeea
Copy link
Copy Markdown

newbeea commented Jan 6, 2022

anything update?

@danielroe danielroe mentioned this pull request Jan 10, 2022
7 tasks
@pi0
Copy link
Copy Markdown
Member

pi0 commented Jan 11, 2022

Closing in the favor of #2655

@pi0 pi0 closed this Jan 11, 2022
@pi0 pi0 deleted the fix/nitro-cdn branch January 11, 2022 18:02
@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 nitro

Projects

None yet

Development

Successfully merging this pull request may close these issues.

404 error everywhere after setting build.publicPath to CDN URL how to build with .mjs/.js/.css hosting on cdn?

4 participants