vite icon indicating copy to clipboard operation
vite copied to clipboard

Failed to load source map for

Open productdevbook opened this issue 2 years ago • 27 comments

Versions

nuxt-vite: 0.2.3 nuxt: 2.15.8

Description

4:18:25 PM [vite] Failed to load source map for /node_modules/.cache/vite/client/pinia.js?v=e1ae41a8.                                                                                                                         16:18:25


 WARN  4:18:25 PM [vite] Failed to load source map for /node_modules/.cache/vite/client/@tiptap_extension-document.js?v=e1ae41a8.                                                                                                    16:18:25


 WARN  4:18:25 PM [vite] Failed to load source map for /node_modules/.cache/vite/client/@tiptap_extension-placeholder.js?v=e1ae41a8.                                                                                                 16:18:25


 WARN  4:18:25 PM [vite] Failed to load source map for /node_modules/.cache/vite/client/@tiptap_starter-kit.js?v=e1ae41a8.                                                                                                           16:18:25


 WARN  4:18:25 PM [vite] Failed to load source map for /node_modules/.cache/vite/client/@tiptap_vue-2.js?v=e1ae41a8.                                                                                                                 16:18:25


 WARN  4:18:26 PM [vite] Failed to load source map for /node_modules/.cache/vite/client/zxcvbn.js?v=e1ae41a8.                                                                                                                        16:18:26

ℹ Vite warmed up in 7395ms                                                                                                                                                                                                           16:18:27

 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/canvas-confetti". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/canvas-confetti". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/fibers". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/fibers". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/tailwindcss". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/tailwindcss". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/zxcvbn". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/zxcvbn". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@nuxtjs/auth-next". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@nuxtjs/auth-next" package


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/lodash". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/lodash". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/canvas-confetti". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/canvas-confetti". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/fibers". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/fibers". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/tailwindcss". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/tailwindcss". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/zxcvbn". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/zxcvbn". The package may have incorrect main/module/exports specified in its package.json.


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@nuxtjs/auth-next". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." entry in "@nuxtjs/auth-next" package


 WARN  Bundling package for SSR due to resolve failure. Failed to resolve entry for package "@types/lodash". The package may have incorrect main/module/exports specified in its package.json: Failed to resolve entry for package "@types/lodash". The package may have incorrect main/module/exports specified in its package.json.


 WARN  invalid import "import(date-fns/locale/${locale}/index.js)". Variable bare imports are not supported, imports must start with ./ in the static part of the import. For example: import(./foo/${bar}.js).        

productdevbook avatar Sep 07 '21 13:09 productdevbook

Can you share a minimal reproduction? Thanks.

antfu avatar Sep 07 '21 14:09 antfu

reproduction: https://github.com/productfrontenddeveloper/nuxt-vite-bug

Sorry for the late reply, it took a while to shrink the project.

graphql note: https://github.com/rollup/plugins/tree/master/packages/graphql

productdevbook avatar Sep 07 '21 15:09 productdevbook

I'm having a similar issue with Vite (different stack: react, typescript)

[vite] Failed to load source map for /node_modules/.vite/ts-dedent.js?v=a21e9b1a.

image

amejiarosario avatar Oct 17 '21 21:10 amejiarosario

@amejiarosario have you been able to fix this? I'm stuck with the same errors.

foxxycodes avatar Nov 22 '21 09:11 foxxycodes

@foxxycodes, unfortunately, no, also I put that project on the back burner for now

amejiarosario avatar Nov 23 '21 16:11 amejiarosario

Stuck with same warnings :(

vinayakkulkarni avatar Nov 29 '21 08:11 vinayakkulkarni

I got similar warnings after setting up Vite on a Nuxt + TSproject



 WARN  12:24:17 AM [vite] Failed to load source map for /node_modules/.cache/vite/client/vue.js?v=e79bfc7a.   00:24:17


 WARN  12:24:21 AM [vite] Failed to load source map for /node_modules/.cache/vite/client/vue-router.js?v=e79bfc7a.```

proup24 avatar Dec 01 '21 00:12 proup24

Also have the same warnings.

toniengelhardt avatar Dec 11 '21 21:12 toniengelhardt

same error when run dev npm script, with install ant design vue

xiangqunXiao avatar Dec 14 '21 13:12 xiangqunXiao

I'm having this same error.

IsaacDdR avatar Dec 14 '21 19:12 IsaacDdR

我也有同样的错误。 image 每次安装新包都会出现,启动后都要半个多小时才能启动,谁能救救我。

a524313390 avatar Dec 21 '21 06:12 a524313390

me too image

catch6 avatar Dec 23 '21 02:12 catch6

me too image

with pnpm

catch6 avatar Dec 23 '21 02:12 catch6

I added all dependencies from [vite] new depencencies found: ... to optimizeDeps.include, it helped.

souljorje avatar Dec 23 '21 14:12 souljorje

@souljorje Thank you that worked.

I had multiple entry points. Specifying them in optimizeDeps.entries helped:

export default defineConfig({
  plugins: [react()],

  optimizeDeps: {
    entries: ['./src/dashboard/app.tsx']
  }
})

OrkhanAlikhanov avatar Dec 25 '21 14:12 OrkhanAlikhanov

very bad experience with this bug ~_~|

hengwangsay avatar Dec 31 '21 09:12 hengwangsay

same bug with using pnpm, I solved this bug by removing loadEnv from .vue component. Drop importing loadEnv.

chemieliu avatar Jan 05 '22 06:01 chemieliu

Same here

retroriff avatar Jan 05 '22 17:01 retroriff

got the same error I'm using pnpm as well image

leegocode avatar Jan 10 '22 03:01 leegocode

me too

xiao-hu00 avatar Jan 20 '22 08:01 xiao-hu00

me too

qq1063823095 avatar Jan 25 '22 08:01 qq1063823095

https://cn.vitejs.dev/config/#optimizedeps-entries 将提示的new dependencies放入到optimizeDeps.includes数组中即可,如下 include: ['lodash-compat', 'history', 'lodash-es'],

或者配置入口项 optimizeDeps.entries# 类型: string | string[]

默认情况下,Vite 会抓取你的 index.html 来检测需要预构建的依赖项。如果指定了 build.rollupOptions.input,Vite 将转而去抓取这些入口点。

如果这两者都不合你意,则可以使用此选项指定自定义条目——该值需要遵循 fast-glob 模式 ,或者是相对于 Vite 项目根的模式数组。这将覆盖掉默认条目推断。

wddpzp avatar Feb 10 '22 09:02 wddpzp

我也有同样的错误。 image 每次安装新包都会出现,启动后都要半个多小时才能启动,谁能救救我。

https://cn.vitejs.dev/config/#optimizedeps-entries 将提示的new dependencies放入到optimizeDeps.includes数组中即可,如下 include: ['lodash-compat', 'history', 'lodash-es'],

或者配置入口项 optimizeDeps.entries# 类型: string | string[]

默认情况下,Vite 会抓取你的 index.html 来检测需要预构建的依赖项。如果指定了 build.rollupOptions.input,Vite 将转而去抓取这些入口点。

如果这两者都不合你意,则可以使用此选项指定自定义条目——该值需要遵循 fast-glob 模式 ,或者是相对于 Vite 项目根的模式数组。这将覆盖掉默认条目推断。

wddpzp avatar Feb 10 '22 09:02 wddpzp

Add this in your vite config file

 build: {
        sourcemap: true,
    },

abdeldjalilhachimi avatar Feb 13 '22 20:02 abdeldjalilhachimi

Add this in your vite config file

 build: {
        sourcemap: true,
    },

Unfortunately this doesn't fix the error

olivervorasai avatar Feb 18 '22 16:02 olivervorasai

Add nuxt.config.ts

ssr: false,
target: 'static',

sekijum avatar Feb 20 '22 16:02 sekijum

I found that open ElementPlusResolver will appear this kind of situation

damengshu avatar Aug 16 '22 01:08 damengshu