teckel12 / vue-pdf

vue.js pdf viewer
MIT License
2 stars 8 forks source link

Cannot build this module since yesterday #7

Open jbeduneauLEGALY opened 1 year ago

jbeduneauLEGALY commented 1 year ago

When I try to build this module, I always get this message

ERROR Failed to compile with 1 error
error in ./node_modules/pdfjs-dist/es5/build/pdf.worker.js Syntax Error: Error: MainTemplate.hooks.hotBootstrap has been removed (use your own RuntimeModule instead)

jbeduneauLEGALY commented 1 year ago

ERROR in ./node_modules/pdfjs-dist/es5/build/pdf.worker.js (./node_modules/@teckel/vue-pdf/node_modules/worker-loader/dist/cjs.js!./node_modules/pdfjs-dist/es5/build/pdf.worker.js) Module build failed (from ./node_modules/@teckel/vue-pdf/node_modules/worker-loader/dist/cjs.js): Error: MainTemplate.hooks.hotBootstrap has been removed (use your own RuntimeModule instead) at Object.tap (/Users/julienbeduneau/GIT/legaly-front/library/node_modules/webpack/lib/MainTemplate.js:215:12) at WebWorkerMainTemplatePlugin.apply (/Users/julienbeduneau/GIT/legaly-front/library/node_modules/@teckel/vue-pdf/node_modules/webpack/lib/webworker/WebWorkerMainTemplatePlugin.js:139:35)

jbeduneauLEGALY commented 1 year ago

Seems I comes from webpack5 but I didn't change anything on my build

teckel12 commented 4 months ago

@jbeduneauLEGALY Are you using npm or yarn? And what version?

marktong11 commented 3 months ago

Unable to get this working after upgrading to webpack 5 as well.

ERROR in ./node_modules/@teckel/vue-pdf/src/pdfjsWrapper.js 230:25-39
export 'PDFLinkService' (imported as 'PDFLinkService') was not found in 'pdfjs-dist/es5/web/pdf_viewer' (module has no exports)

May or may not be due to a dependency issue with worker-loader but I'm not super familiar with webpack. I get this from my yarn integrity check:

warning "@teckel/vue-pdf > pdfjs-dist@2.7.570" has incorrect peer dependency "worker-loader@^3.0.7".
warning "@teckel/vue-pdf > worker-loader@2.0.0" has incorrect peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0"

Edit: I am dumb and was not resolving .js files in my webpack config. Seems to be working for me now.