質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

解決済

1回答

959閲覧

ブログアプリをherokuにデプロイしたい

kakedashi

総合スコア4

Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

1クリップ

投稿2019/11/28 10:55

編集2019/11/28 17:31

前提・実現したいこと

railsにvue.jsやwebpackerを導入し、簡単なブログアプリを作っています。
そのアプリをherokuにデプロイしたいです。

発生している問題・エラーメッセージ

git push heroku masterを実行した際に以下のエラーが出ます。

Compiling… remote: Compilation failed: remote: /tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/cli.js:93 remote: throw err; remote: ^ remote: remote: Error: Cannot find module 'vue-loader' remote: Require stack: remote: - /tmp/build_c71aa97607d619bf9241fefb23db6389/config/webpack/environment.js remote: - /tmp/build_c71aa97607d619bf9241fefb23db6389/config/webpack/production.js remote: - /tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/utils/convert-argv.js remote: - /tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/cli.js remote: - /tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack/bin/webpack.js remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15) remote: at Function.Module._load (internal/modules/cjs/loader.js:690:27) remote: at Module.require (internal/modules/cjs/loader.js:852:19) remote: at require (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) remote: at Object.<anonymous> (/tmp/build_c71aa97607d619bf9241fefb23db6389/config/webpack/environment.js:2:29) remote: at Module._compile (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) remote: at Module.load (internal/modules/cjs/loader.js:815:32) remote: at Function.Module._load (internal/modules/cjs/loader.js:727:14) remote: at Module.require (internal/modules/cjs/loader.js:852:19) remote: at require (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) remote: at Object.<anonymous> (/tmp/build_c71aa97607d619bf9241fefb23db6389/config/webpack/production.js:3:21) remote: at Module._compile (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) remote: at Module.load (internal/modules/cjs/loader.js:815:32) remote: at Function.Module._load (internal/modules/cjs/loader.js:727:14) remote: at Module.require (internal/modules/cjs/loader.js:852:19) remote: at require (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/v8-compile-cache/v8-compile-cache.js:161:20) remote: at WEBPACK_OPTIONS (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13) remote: at requireConfig (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6) remote: at /tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17 remote: at Array.forEach (<anonymous>) remote: at module.exports (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15) remote: at /tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/cli.js:71:45 remote: at Object.parse (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18) remote: at /tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/cli.js:49:8 remote: at Object.<anonymous> (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/cli.js:366:3) remote: at Module._compile (internal/modules/cjs/loader.js:959:30) remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) remote: at Module.load (internal/modules/cjs/loader.js:815:32) remote: at Function.Module._load (internal/modules/cjs/loader.js:727:14) remote: at Module.require (internal/modules/cjs/loader.js:852:19) remote: at require (internal/modules/cjs/helpers.js:74:18) remote: at Object.<anonymous> (/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack/bin/webpack.js:156:2) remote: at Module._compile (internal/modules/cjs/loader.js:959:30) remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) { remote: code: 'MODULE_NOT_FOUND', remote: requireStack: [ remote: '/tmp/build_c71aa97607d619bf9241fefb23db6389/config/webpack/environment.js', remote: '/tmp/build_c71aa97607d619bf9241fefb23db6389/config/webpack/production.js', remote: '/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/utils/convert-argv.js', remote: '/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack-cli/bin/cli.js', remote: '/tmp/build_c71aa97607d619bf9241fefb23db6389/node_modules/webpack/bin/webpack.js' remote: ] remote: } remote:

該当のソースコード

config/webpack/environment.js

const { environment } = require('@rails/webpacker') const { VueLoaderPlugin } = require('vue-loader') const vue = require('./loaders/vue') module.exports = { module: { rules: [ // ... other rules { test: /.vue$/, loader: 'vue-loader' } ] }, plugins: [ // make sure to include the plugin! new VueLoaderPlugin() ] } module.exports = environment environment.plugins.prepend('VueLoaderPlugin', new VueLoaderPlugin()) environment.loaders.prepend('vue', vue) module.exports = environment const customConfig = require('./custom') environment.config.merge(customConfig) module.exports = environment

試したこと

vue-loader,webpack,webpacker,vue-loader,node_modulesについて調べ、試しましたが解決することができませんでした。

補足情報(FW/ツールのバージョンなど)

ruby '2.5.1'
rails', '> 5.2.3'
webpacker', '
> 4.x'
"vue-loader": "^15.7.2",
"vue": "^2.6.10",

足りないところありましたら言ってください。よろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

テキストエディタには表示されていたのですが、実際には入っておらず手動で入れたところ解決しました。

投稿2019/11/29 11:56

kakedashi

総合スコア4

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

toratail

2020/12/22 09:11

コメント失礼します。 私も現在、同じエラーで詰まってしまっているのですが どちらの方に手動で記入しましたでしょうか。 ご教授いただけると幸いです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問