N
Nuxt8mo ago
dubs

Failed to load source map

Description I'm not entirely sure if this is an error within nuxt, vite, radix-vue, or internationalized/date, but I wasn't able to find this same error anywhere else, so maybe it'll be useful. When putting a shadcn-vue Button component inside the app.vue template there are more than 10 warnings as shown in the attachment presumably while the vite server is loading. Reproduce:
npx nuxi@latest init test-app
npm install -D typescript
npx nuxi@latest module add @nuxtjs/tailwindcss
npx nuxi@latest module add shadcn-nuxt
npx shadcn-vue@latest init # select all defaults except framework (use nuxt)
npx shadcn-vue@latest add button
npx nuxi@latest init test-app
npm install -D typescript
npx nuxi@latest module add @nuxtjs/tailwindcss
npx nuxi@latest module add shadcn-nuxt
npx shadcn-vue@latest init # select all defaults except framework (use nuxt)
npx shadcn-vue@latest add button
Put a <Button> component in the app.vue template
npm install
npm run dev # see "failed to load source map..." errors
npm install
npm run dev # see "failed to load source map..." errors
Alternatively, this and a few other tests are set up in this stackblitz repo. Solution (ish) Only use the Button component (or components that use the Button component) in a page or layout rather than in app.vue. Other notes - radix-vue depends on internationalized/date, and shadcn-nuxt depends on radix-vue - disabling source maps in nuxt config doesn't stop the warning from showing - adding vite.build.sourcemap = false and vite.server.fs.strict = false didn't change anything either - the warnings only show when running the dev server and not when building or in production - the files do actually exist in the locations it says they don't Hopefully this helps someone else, and if someone has an idea of where the error came from or what caused it so I can open a github issue there that'd be appreciated.
StackBlitz
Source map error reproducable - StackBlitz
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server