FranckFreiburger / vue-pdf

vue.js pdf viewer
MIT License
2.23k stars 524 forks source link

vue2项目编译报错 #411

Open BayMax619 opened 1 year ago

BayMax619 commented 1 year ago

ERROR Failed to compile with 1 error 上午8:48:14

error in ./node_modules/pdfjs-dist/es5/build/pdf.worker.js

Syntax Error: TypeError: The 'compilation' argument must be an instance of Compilation

ERROR in ./node_modules/pdfjs-dist/es5/build/pdf.worker.js (./node_modules/worker-loader/dist/cjs.js!./node_modules/pdfjs-dist/es5/build/pdf.worker.js) Module build failed (from ./node_modules/worker-loader/dist/cjs.js): TypeError: The 'compilation' argument must be an instance of Compilation at getCompilationHooks (D:\skeleton\node_modules\webpack\lib\javascript\JavascriptModulesPlugin.js:143:10) at D:\skeleton\node_modules\webpack\lib\javascript\ArrayPushCallbackChunkFormatPlugin.js:41:19 at Hook.eval [as call] (eval at create (D:\skeleton\node_modules\tapable\lib\HookCodeFactory.js:19:10), :7:1) at Hook.CALL_DELEGATE [as _call] (D:\skeleton\node_modules\tapable\lib\Hook.js:14:14) at Compiler.newCompilation (D:\skeleton\node_modules\@vue\cli-service\node_modules\webpack\lib\Compiler.js:1121:30) at D:\skeleton\node_modules\@vue\cli-service\node_modules\webpack\lib\Compiler.js:1166:29 at Hook.eval [as callAsync] (eval at create (D:\skeleton\node_modules\tapable\lib\HookCodeFactory.js:33:10), :24:1) at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D:\skeleton\node_modules\tapable\lib\Hook.js:18:14) at Compiler.compile (D:\skeleton\node_modules\@vue\cli-service\node_modules\webpack\lib\Compiler.js:1161:28) at Compiler.runAsChild (D:\skeleton\node_modules\@vue\cli-service\node_modules\webpack\lib\Compiler.js:561:8) at Object.pitch (D:\skeleton\node_modules\worker-loader\dist\index.js:115:19)

chenbingchang commented 1 year ago

这个可以解决,https://github.com/FranckFreiburger/vue-pdf/issues/25#issuecomment-613334773

AKAking23 commented 1 year ago

能解决吗 我现在还是报错