Jakey08 / rails-tutorial-sample-app

0 stars 0 forks source link

webpack が compile error となる #32

Open Jakey08 opened 2 years ago

Jakey08 commented 2 years ago

docker で webpack を起動しても、compile が落ちるので、修正したい。

module の build が失敗してるのが原因だと考えられる。


webpacker    | ERROR in ./app/javascript/packs/application.js
webpacker    | Module build failed (from ./node_modules/babel-loader/lib/index.js):
webpacker    | Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/plugin-syntax-dynamic-import' imported from /app/babel-virtual-resolve-base.js
webpacker    |     at __node_internal_ (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:2844:9)
webpacker    |     at __node_internal_ (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:2802:11)
webpacker    |     at new NodeError (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:2795:5)
webpacker    |     at packageResolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3451:9)
webpacker    |     at moduleResolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3485:18)
webpacker    |     at defaultResolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3524:13)
webpacker    |     at /app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3547:14
webpacker    |     at Generator.next (<anonymous>)
webpacker    |     at asyncGeneratorStep (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:63:103)
webpacker    |     at _next (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:194)
webpacker    |     at /app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:364
webpacker    |     at new Promise (<anonymous>)
webpacker    |     at /app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:97
webpacker    |     at resolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3537:19)
webpacker    |     at /app/node_modules/@babel/core/lib/config/files/import-meta-resolve.js:38:38
webpacker    |     at Generator.next (<anonymous>)
webpacker    |     at asyncGeneratorStep (/app/node_modules/@babel/core/lib/config/files/import-meta-resolve.js:20:103)
webpacker    |     at _next (/app/node_modules/@babel/core/lib/config/files/import-meta-resolve.js:22:194)
webpacker    |
webpacker    | ERROR in (webpack)-dev-server/client?http://localhost:3035
webpacker    | Module build failed (from ./node_modules/babel-loader/lib/index.js):
webpacker    | Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@babel/preset-env' imported from /app/babel-virtual-resolve-base.js
webpacker    |     at __node_internal_ (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:2844:9)
webpacker    |     at __node_internal_ (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:2802:11)
webpacker    |     at new NodeError (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:2795:5)
webpacker    |     at packageResolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3451:9)
webpacker    |     at moduleResolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3485:18)
webpacker    |     at defaultResolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3524:13)
webpacker    |     at /app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3547:14
webpacker    |     at Generator.next (<anonymous>)
webpacker    |     at asyncGeneratorStep (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:63:103)
webpacker    |     at _next (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:194)
webpacker    |     at /app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:364
webpacker    |     at new Promise (<anonymous>)
webpacker    |     at /app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:65:97
webpacker    |     at resolve (/app/node_modules/@babel/core/lib/vendor/import-meta-resolve.js:3537:19)
webpacker    |     at /app/node_modules/@babel/core/lib/config/files/import-meta-resolve.js:38:38
webpacker    |     at Generator.next (<anonymous>)
webpacker    |     at asyncGeneratorStep (/app/node_modules/@babel/core/lib/config/files/import-meta-resolve.js:20:103)
webpacker    |     at _next (/app/node_modules/@babel/core/lib/config/files/import-meta-resolve.js:22:194)
webpacker    | ℹ 「wdm」: Failed to compile.
Jakey08 commented 2 years ago

rails 6 に特にこだわりはないので、 rails 7 に upggrade しても良いかも