vue-pdf icon indicating copy to clipboard operation
vue-pdf copied to clipboard

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

Open zengqinhll opened this issue 2 years ago • 14 comments

process is not defined at vuePdfNoSss

zengqinhll avatar Aug 03 '22 02:08 zengqinhll

I have the same error in vue 3

FrancoMSarabia avatar Aug 05 '22 20:08 FrancoMSarabia

I have the same error as well

SagarVishal avatar Aug 09 '22 08:08 SagarVishal

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

yaelahan avatar Aug 22 '22 08:08 yaelahan

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

xYx-c avatar Sep 13 '22 02:09 xYx-c

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.

silverlovesl avatar Sep 17 '22 06:09 silverlovesl

I have the same error in vue 3

ZzzilH avatar Sep 21 '22 06:09 ZzzilH

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?

toplyb avatar Nov 03 '22 07:11 toplyb

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

yumeiqiang avatar Nov 30 '22 08:11 yumeiqiang

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 avatar Feb 22 '23 08:02 chenweigh

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)

chenweigh avatar Feb 22 '23 08:02 chenweigh

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 avatar Nov 17 '23 01:11 AnndyBrick