FranckFreiburger / vue-pdf

vue.js pdf viewer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vite 创建的Vue3项目不能引入 vue-pdf,报错process is not defined at vuePdfNoSss

zengqinhll opened this issue · comments

process is not defined at vuePdfNoSss

I have the same error in vue 3

I have the same error as well

꧋ꦱꦪꦩꦼꦤ꧀ꦝꦥꦠ꧀ꦏꦤ꧀ꦩꦱꦭꦃꦪꦁꦱꦩꦏꦼꦠꦶꦏꦩꦼꦁꦒꦸꦤꦏꦤ꧀ꦮ꦳ꦶꦠꦺ

commented

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 get require is not a function. When will it be resolved?

https://www.npmjs.com/package/dy-vite-vue-pdf 试试这个

commented

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 怎么办

commented

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)

commented

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)

想问下最后有找到解决方法吗?

i have some erro in vue3 project, seem the repo not support vue3+vite😢

dont try install with vite