Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lkho opened this issue Oct 30, 2023 · 3 comments

Comments

@lkho
Copy link

lkho commented Oct 30, 2023

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

@stackblitz
Copy link

stackblitz bot commented Oct 30, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@danielroe
Copy link
Member

From the look of it, I believe this is an upstream bug in vite or vite-node that has already been fixed but hasn't yet been released, either vitest-dev/vitest#4049 or vitejs/vite#14241.

@lkho
Copy link
Author

lkho commented Oct 30, 2023

Oh thanks for the prompt answer, then I'll stay tune for the next release 😆

@danielroe danielroe removed the 3.x label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants