Skip to content

dev server error 500 ERR_LOAD_URL if app.buildAssetsDir same as source directory name #24035

Open

Description

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.8.0
  • CLI Version: 3.9.1
  • Nitro Version: 2.7.2
  • Package Manager: npm@9.4.2
  • Builder: -
  • User Config: devtools, app, css
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-hcnr1y-8cm86s?file=nuxt.config.ts

Describe the bug

If you try to import a global css, which resides in a source directory with a name same as the app.buildAssetsDir, the dev server will not load the file.

i.e.:

export default defineNuxtConfig({
  devtools: { enabled: true },
  app: {
    buildAssetsDir: 'abc'
  },
  css: [
    '@/abc/main.css'
  ]
})

Affects nuxi dev only.
However, build and generate are fine.

error shown:

500
[vite-node] [ERR_LOAD_URL] /main.css

Additional context

You can confirm it is a bug by changing the app.buildAssetsDir to something else, e.g. abc1, then it will work again.

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions