Skip to content

404 error everywhere after setting build.publicPath to CDN URL #12922

@ghost

Description

Environment


  • Operating System: Linux
  • Node Version: v14.18.1
  • Nuxt Version: 3.0.0-27304790.cad09fe
  • Package Manager: npm@6.14.15
  • Bundler: Vite
  • User Config: build, css, publicRuntimeConfig, vite
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://codesandbox.io/s/new-wood-hx840?file=/nuxt.config.ts

Notes:

  • The sandbox is configured in a way that the code is ran in production mode (npm run build && npm run start)
  • The CDN URL used is a BunnyCDN Pull Zone. The pull zone is set to fetch files from the sandbox URL:
    ss215-skrypt

Describe the bug

After build.publicPath in nuxt.config.ts is changed to any URL, the whole application (pages and assets) will return a 404 error. Changing it to a single folder name, no errors occur.

Additional context

As of my understanding, changing build.publicPath to a CDN URL would make all assets go into the .output/public folder instead of the .output/public/_nuxt folder. The assets are actually there, but navigating to them also returns a 404 error.

Logs

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions