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

Package not compatible with Vue cli version 5.x

Open dvago opened this issue 3 years ago • 15 comments

The newer version of vue-cli 5.x migrates from webpack 4 to webpack 5, the newer version of webpack does change the support for web workers.

So, the latest version of vue-pdf throws the following error:

ERROR in ./node_modules/pdfjs-dist/es5/build/pdf.worker.js (./node_modules/vue-pdf/node_modules/worker-loader/dist/cjs.js!./node_modules/pdfjs-dist/es5/build/pdf.worker.js)

Module build failed (from ./node_modules/vue-pdf/node_modules/worker-loader/dist/cjs.js):
Error: MainTemplate.hooks.hotBootstrap has been removed (use your own RuntimeModule instead)

Would you please update this package to make it run with vue-cli 5?

dvago avatar Feb 23 '22 17:02 dvago

same problem as you, do I have to downgrade to VUE-CLI4.0

liu-guo-jing avatar Mar 27 '22 03:03 liu-guo-jing

Same issue here while migrating to vue-cli 5.x

YSoli avatar Apr 02 '22 10:04 YSoli

Same here

image

kstraszewski avatar Apr 04 '22 22:04 kstraszewski

same +1

xuxusheng avatar Apr 08 '22 15:04 xuxusheng

+1

EugeneKuzmin avatar Apr 10 '22 13:04 EugeneKuzmin

This is strange. I don't know what I did, but it works for me. However, it uses worker-loader which outputs DEP_WEBPACK_COMPILATION_CACHE and DEP_WEBPACK_DEPRECATION_ARRAY_TO_SET_INDEXER with Webpack 5 brought by vue-cli 5.

Glandos avatar Apr 13 '22 15:04 Glandos

same +1

Byteschmiede avatar Apr 20 '22 10:04 Byteschmiede

@liugj101 I ended up forking the project, cleaning up the code and make it work for vue-cli 5, this vue-pdf project is clearly dead, it's pretty pointless waiting for any maintainer doing anything.

dvago avatar Apr 21 '22 08:04 dvago

@dvago Are you able to share those changes, or was only a catch call needed? https://github.com/dvago/vue-pdf

cwilby avatar Apr 29 '22 16:04 cwilby

Not really, I created a package within my company git account and stripped out lots of features that we don't use to run it as simple as possible, so the package is not called vue-pdf anymore and it's not public.

I don't think it makes sense for me to publish a clone of it as I'm not going to be able to maintain it or keep up with the eventual broad public requests to be fair, hope that makes sense.

dvago avatar Apr 29 '22 17:04 dvago

same +1

MoNaiZi avatar May 16 '22 08:05 MoNaiZi

@MoNaiZi This package works well - https://github.com/hrynko/vue-pdf-embed

cwilby avatar May 16 '22 16:05 cwilby

+1 ERROR in ./node_modules/pdfjs-dist/es5/build/pdf.worker.js (./node_modules/vue-pdf/node_modules/worker-loader/dist/cjs.js!./node_modules/pdfjs-dist/es5/build/pdf.worker.js)

chenweigh avatar Feb 22 '23 09:02 chenweigh

Are there any other good solutions besides using vue-pdf-embed?

brizer avatar Oct 26 '23 07:10 brizer

+1

ziyang314 avatar Apr 17 '24 03:04 ziyang314