md-editor-extension icon indicating copy to clipboard operation
md-editor-extension copied to clipboard

Nuxt 3.12 使用这个扩展报错

Open huxiaofeng1983 opened this issue 1 year ago • 6 comments

启动nuxt会报以下错误: WARN Failed to load source map for /ssr-project/node_modules/html2pdf.js/dist/html2pdf.js. 22:54:15 Error: An error occurred while trying to read the map file at es6-promise.map Error: ENOENT: no such file or directory, open '/ssr-project/node_modules/html2pdf.js/dist/es6-promise.map'

huxiaofeng1983 avatar Jul 24 '24 15:07 huxiaofeng1983

取消生成source map试试,这个组件没有提供source map

imzbf avatar Jul 25 '24 07:07 imzbf

不知道怎样取消,在网上查了好几种配置方法都不管用,刚接触 nuxt,只是为了ssr,太麻烦了

huxiaofeng1983 avatar Jul 26 '24 12:07 huxiaofeng1983

你可以考虑这样做,在 nuxt.config.js 文件中,添加或修改 build 配置对象,并设置 transpile 选项中的 sourceMap 属性为 false(对于生产环境)。

export default {
  // ...
  build: {
    transpile: {
      // Disable source maps for production builds
      sourceMap: process.env.NODE_ENV !== 'production',
    },
  },
  // ...
}

imzbf avatar Jul 29 '24 00:07 imzbf

不行,好像不能这么配置,IDE报错:Vue: Object literal may only specify known properties, and sourceMap does not exist in type 官方文档说类型为数组:https://nuxt.com/docs/api/nuxt-config#transpile

huxiaofeng1983 avatar Jul 29 '24 02:07 huxiaofeng1983

这个问题保留一段时间,看有其他使用nuxt的伙伴有了解这类问题的能否提供帮助

imzbf avatar Jul 29 '24 06:07 imzbf

谢谢大佬的耐心回复!

huxiaofeng1983 avatar Jul 29 '24 08:07 huxiaofeng1983