vue-pdf
vue-pdf copied to clipboard
vite 创建的Vue3项目不能引入 vue-pdf,报错process is not defined at vuePdfNoSss
process is not defined at vuePdfNoSss
I have the same error in vue 3
I have the same error as well
꧋ꦱꦪꦩꦼꦤ꧀ꦝꦥꦠ꧀ꦏꦤ꧀ꦩꦱꦭꦃꦪꦁꦱꦩꦏꦼꦠꦶꦏꦩꦼꦁꦒꦸꦤꦏꦤ꧀ꦮ꦳ꦶꦠꦺ
vue2也一样,应该是这个库使用了require?
I have the same error as well
process.env
is removed from vite by commit 8ad7ec
you can add
define: {
'process.env': {},
},
into your vite.config.ts
BTW , this library seems not working for vite so far.
I have the same error in vue 3
I had the same problem in vite 3.2
, at the same time, I get require is not a function
. When will it be resolved?
I had the same problem in
vite 3.2
, at the same time, I getrequire is not a function
. When will it be resolved?
https://www.npmjs.com/package/dy-vite-vue-pdf 试试这个
vite3+vue3 问题1: require 不能用,install vite-plugin-require-transform 问题2: [plugin:vite:import-analysis] Failed to resolve import "worker-loader!pdfjs-dist/es5/build/pdf.worker.js" from "node_modules/vue-pdf/src/vuePdfNoSss.vue". Does the file exist? 问题1 fix后,又遇到问题2,推测是安装了1的问题。 崩溃中。。。 vite 怎么办
https://www.npmjs.com/package/dy-vite-vue-pdf
dy-vite-vue-pdf
也有问题
SyntaxError: The requested module '/node_modules/dy-vite-vue-pdf/src/pdf.worker.min.js?v=f9c00aee' does not provide an export named 'default' (at viteVuePdf.vue:7:8)
https://www.npmjs.com/package/dy-vite-vue-pdf
dy-vite-vue-pdf
也有问题 SyntaxError: The requested module '/node_modules/dy-vite-vue-pdf/src/pdf.worker.min.js?v=f9c00aee' does not provide an export named 'default' (at viteVuePdf.vue:7:8)
想问下最后有找到解决方法吗?