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

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

Open
bootsmann1995 opened this issue Jun 9, 2022 · 25 comments

Comments

@bootsmann1995
Copy link

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. vitejs/vite#5438

Logs

No response

@baixiaoyu2997
Copy link
Contributor

same issue , *.ts file in /pages will show this warn:

Sourcemap for "/Users/l.rain/Documents/workspace/DEMO/learn-nuxt3/pages/test.ts" points to missing source files    

@danielroe
Copy link
Member

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

@danielroe
Copy link
Member

I'm sorry, it's the virtual module id I'm talking about, and not something you can do.

@bootsmann1995

This comment was marked as duplicate.

@hqwlkj

This comment was marked as duplicate.

@jakubhruby

This comment was marked as duplicate.

@sandercoffee

This comment was marked as duplicate.

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
@BayBreezy

This comment was marked as duplicate.

@moealien

This comment was marked as duplicate.

@rashidpathiyil
Copy link

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

Copy link
Member

danielroe commented Mar 28, 2023

This should be resolved in the latest Vite release (v4.2.1) via vitejs/vite#12444. Perhaps try refreshing your lockfile and confirming?

@rashidpathiyil
Copy link

This should be resolved in the latest Vite release (v4.2.1) via vitejs/vite#12444. Perhaps try refreshing your lockfile and confirming?

That error is gone when I run this now
image

But the login only works after downgrading this
"@nuxt-alt/auth": "2.2.0",
"@nuxt-alt/http": "1.5.7",

Anyway thanks Dani 💚

@jakubhruby
Copy link

jakubhruby commented Mar 28, 2023

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"

@leosin
Copy link

leosin commented Apr 21, 2023

I just loaded a normal scss file.

but
I can remove warn in this way,

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

@wtagain
Copy link

wtagain commented Jun 2, 2023

Same issue.

@horizon188
Copy link

Same issue.

@horizon188
Copy link

nuxt:3.5.0

@VegasChickiChicki
Copy link

Same issue.

1 similar comment
@shynline
Copy link

shynline commented Aug 1, 2023

Same issue.

@bootsmann1995
Copy link
Author

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

@AhmedKaram50
Copy link

image

any ideas ?

i am using Nuxt 3.3 with i18n

@AndrewBogdanovTSS
Copy link

AndrewBogdanovTSS commented Oct 18, 2023

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

@mhdSid
Copy link

mhdSid commented Oct 26, 2023

same issue

1 similar comment
@dojo-coder
Copy link

same issue

@rczdgbg
Copy link

rczdgbg commented Jan 26, 2024

image

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