前提・実現したいこと
railsにvue.jsやwebpackerを導入し、簡単なブログアプリを作っています。
そのアプリをherokuにデプロイしたいです。
発生している問題・エラーメッセージ
bundle exec rake assets:precompile RAILS_ENV=production を実行した際に以下のエラーが出ます。
Compiling… Compilation failed: Version: webpack 4.41.2 Time: 1673ms 14 assets Entrypoint application = js/application-32085f51ae7523a7c361.js js/application-32085f51ae7523a7c361.js.map Entrypoint components/index = js/components/index-f7eaac5534c769be355f.js js/components/index-f7eaac5534c769be355f.js.map Entrypoint components/MyModal = js/components/MyModal-16039e3d9fd3766f06ff.js js/components/MyModal-16039e3d9fd3766f06ff.js.map Entrypoint hello_vue = js/hello_vue-b95e5aba8233676cad8a.js js/hello_vue-b95e5aba8233676cad8a.js.map Entrypoint hoge = js/hoge-0f49b093e0e5e32f377f.js js/hoge-0f49b093e0e5e32f377f.js.map Entrypoint router/router = js/router/router-da3216eeef5236e66908.js js/router/router-da3216eeef5236e66908.js.map [1] (webpack)/buildin/global.js 878 bytes {4} {5} [built] [3] ./app/javascript/packs/router/router.js + 1 modules 71.2 KiB {4} {5} [built] | ./app/javascript/packs/router/router.js 216 bytes [built] | + 1 hidden module [9] ./app/javascript/packs/application.js 896 bytes {0} [built] [11] ./app/javascript/packs/hello_vue.js 1.87 KiB {3} [built] [12] ./app/javascript/packs/hoge.js 2.15 KiB {4} [built] [13] (webpack)/buildin/module.js 552 bytes {4} [built] + 8 hidden modules ERROR in ./app/javascript/packs/components/index.vue Module Error (from ./node_modules/vue-loader/lib/index.js): [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options. ERROR in ./app/javascript/packs/components/MyModal.vue Module Error (from ./node_modules/vue-loader/lib/index.js): [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options. ERROR in ./app/javascript/packs/components/index.vue Module build failed (from ./node_modules/vue-loader/lib/index.js): TypeError: Cannot read property 'parseComponent' of undefined at parse (/Users/hokurou/projects/t3blog/node_modules/@vue/component-compiler-utils/dist/parse.js:14:23) at Object.module.exports (/Users/hokurou/projects/t3blog/node_modules/vue-loader/lib/index.js:67:22) ERROR in ./app/javascript/packs/components/MyModal.vue Module build failed (from ./node_modules/vue-loader/lib/index.js): TypeError: Cannot read property 'parseComponent' of undefined at parse (/Users/hokurou/projects/t3blog/node_modules/@vue/component-compiler-utils/dist/parse.js:14:23) at Object.module.exports (/Users/hokurou/projects/t3blog/node_modules/vue-loader/lib/index.js:67:22)
該当のソースコード
ソースコード
試したこと
エラー文にも書いてある通り、vue-template-compiler をインストールしたのですが、解決せず。
補足情報(FW/ツールのバージョンなど)
ruby '2.5.1'
rails', '> 5.2.3'> 4.x'
webpacker', '
"vue-loader": "^15.7.2",
"vue": "^2.6.10",
足りないところありましたら言ってください。よろしくお願いします。
あなたの回答
tips
プレビュー