code-farmer-i / vue-markdown-editor

A markdown editor built on Vue
https://code-farmer-i.github.io/vue-markdown-editor/
MIT License
1.07k stars 110 forks source link

nuxt3使用generate打包报错,createLineNumbertPlugin is not a function #264

Open cejune opened 11 months ago

cejune commented 11 months ago

nuxt3使用generate打包报错 ERROR [nuxt] [request error] [unhandled] [500] createLineNumbertPlugin is not a function
at ./.nuxt/prerender/chunks/app/server.mjs:3330:8
at ModuleJob.run (node:internal/modules/esm/module_job:194:25) WX20231028-112309

lincenying commented 8 months ago

同错...

Niushuaik commented 6 months ago

服务端渲染是不行的,在服务端渲染不要渲染。 if (!process.server){ await nextTick(() => { VMdPreview.use(createLineNumbertPlugin()); VMdPreview.use(createCopyCodePlugin()); }) } 这样会导致第一打开文章页面会无法加载插件。如果是其他页面通过路由跳转,可以正常使用

ShnHz commented 1 month ago

同错,该如何解决这个问题