FranckFreiburger / vue-pdf

vue.js pdf viewer
MIT License
2.21k stars 520 forks source link

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

Open zengqinhll opened 2 years ago

zengqinhll commented 2 years ago

process is not defined at vuePdfNoSss

FrancoMSarabia commented 2 years ago

I have the same error in vue 3

SagarVishal commented 2 years ago

I have the same error as well

yaelahan commented 2 years ago

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

xYx-c commented 2 years ago

vue2也一样,应该是这个库使用了require?

silverlovesl commented 2 years ago

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.

ZzzilH commented 2 years ago

I have the same error in vue 3

toplyb commented 1 year ago

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?

yumeiqiang commented 1 year ago

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 试试这个

chenweigh commented 1 year ago

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

chenweigh commented 1 year ago

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)

AnndyBrick commented 10 months ago

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)

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

frallisland commented 7 months ago

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

a21ns1g4ts commented 6 months ago

dont try install with vite

mariree commented 1 month ago

same problem in vite 5.4.0, at the same time, I get require is not a function