nuxt: Nuxt 3, sourcemap points to missing file warning, when using external script files in vue template.

Environment

  • Operating System: Windows_NT
  • Node Version: v16.13.2
  • Nuxt Version: 3.0.0-rc.3
  • Package Manager: npm@8.3.0
  • Builder: vite
  • User Config: privateRuntimeConfig, publicRuntimeConfig, pageTransition, css, app, algolia, components, router, modules, build, vite, hooks, nitro
  • Runtime Modules: @vueuse/nuxt@8.6.0, ~/modules/sitemap, @nuxtjs/algolia@0.9.2, ~/modules/robots, ~/modules/staticWebApp
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-jbyf5k-sa9vua?file=pages%2Findex.vue

Describe the bug

When using external script files it gives an warning pr. import in my solution:

“Sourcemap for “C:/Folder/repo/filepath.page.ts” points to missing source files .”

image

Is there a confirguration to disable sourcemap for at certain suffix file? I think this is poitning to vite in nuxt.

Additional context

I can see there is a similar issue on react regarding this warning. https://github.com/vitejs/vite/issues/5438

Logs

No response

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 14
  • Comments: 25 (4 by maintainers)

Most upvoted comments

Hey team,

This issue popped up again in v3.1.1. Not sure if it was resolved before. I am using vuetify v3.1.2 with the vite-plugin-vuetify package.

I still have the warning messages after upgrading lockfile and cleaning yarn cache and node_modules.

"vite@^3.0.0 || ^4.0.0", vite@~4.2.1:
  version "4.2.1"
  resolved "https://registry.yarnpkg.com/vite/-/vite-4.2.1.tgz#6c2eb337b0dfd80a9ded5922163b94949d7fc254"
  integrity sha512-7MKhqdy0ISo4wnvwtqZkjke6XN4taqQ2TBaTccLIpOKv7Vp2h4Y+NpmWCnGDeSvvn45KxvWgGyb0MkHvY1vgbg==
  dependencies:
    esbuild "^0.17.5"
    postcss "^8.4.21"
    resolve "^1.22.1"
    rollup "^3.18.0"
  optionalDependencies:
    fsevents "~2.3.2"

Present again in stable 3.0.0

Same issue.

Note to self or whoever looks at this first: Issue can be resolved by prefixing with \0 or dep: (https://github.com/vitejs/vite/pull/5587) - but see https://github.com/nuxt/framework/pull/4512 for context - we will need to ensure we’re still transforming virtual modules with other plugins.

@horizon188 @VegasChickiChicki @shynline you can use sourcemap: false in nuxt.config

Getting this error after upgrading to Nuxt 3.3.2 and login stop working

WARN  Sourcemap for "virtual:nuxt:/Users/rashidpathiyil/<project>/.nuxt/http.plugin.mjs" points to missing source files

WARN  Sourcemap for "virtual:nuxt:/Users/rashidpathiyil/<project>/.nuxt/auth.plugin.mjs" points to missing source files

I tried

export default defineNuxtConfig({
  sourcemap: { server: true, client: false }
})

but still get warnings image

What is even more interesting is that it doesn’t disappear even if I set both to false

I just loaded a normal scss file.

but I can remove warn in this way,

export default defineNuxtConfig({
  sourcemap: { server: true, client: false }
})

Has this issue been fixed?