Skip to content

When using vite in dev, router.path is not honored for _nuxt/ files. #12652

@Schetnan

Description

@Schetnan

Environment

  • Operating System: Darwin
  • Node Version: v14.16.1
  • Nuxt Version: 3.0.0-27252999.d2cc9e4
  • Package Manager: npm
  • Bundler: Webpack
  • User Config: vite, nitro, router, serverMiddleware
  • Runtime Modules: -
  • Build Modules: -

Describe the bug

When using vite in nuxt3 development mode ( npm run dev ), _nuxt files do not honor the router.base path.

Reproduction

export default defineNuxtConfig({
    router: {
        base: '/fcp/myApp'
    }
})

App is fronted by a proxy. http://localhost:3000 is proxied to by the following line in an http-proxy-middleware config.

app.use('/fcp/myApp', proxy({ target: "http://localhost:3000"}))

Go to app.
https://localhost:8443/fcp/myApp

App loads, and partially works, but is not fully functional with the following errors in the browser. The _nuxt/ files cannot be found, because they do not honor the router.base configuration.

GET https://localhost:8443/_nuxt/@vite/client net::ERR_ABORTED 404 (Not Found)
myApp:527 GET https://localhost:8443/_nuxt/entry.mjs net::ERR_ABORTED 404 (Not Found)
myApp:1 GET https://localhost:8443/_nuxt/entry.mjs net::ERR_ABORTED 404 (Not Found)
myApp:1 GET https://localhost:8443/_nuxt/@vite/client net::ERR_ABORTED 404 (Not Found)

Additional context

No response

Logs

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions