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

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

新規登録して質問してみよう
ただいま回答率
85.47%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

Q&A

解決済

1回答

2183閲覧

【デプロイ失敗】モジュールのビルドに失敗しました

pais

総合スコア1

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

ビルド

ソースコードを単体で実行可能なソフトウェアへ変換する過程をビルド(build)と呼びます

JavaScript

JavaScriptは、プログラミング言語のひとつです。ネットスケープコミュニケーションズで開発されました。 開発当初はLiveScriptと呼ばれていましたが、業務提携していたサン・マイクロシステムズが開発したJavaが脚光を浴びていたことから、JavaScriptと改名されました。 動きのあるWebページを作ることを目的に開発されたもので、主要なWebブラウザのほとんどに搭載されています。

0グッド

0クリップ

投稿2021/06/03 01:02

デプロイの際にエラーが発生しており解決したい

こんにちは
Rubyで簡単な画像投稿アプリを作成しております。
デプロイする際にエラーが発生しており解決方法をご教授いただけますと幸いです。

発生しているエラー

(herokuにプッシュする際のターミナル上のエラー)

remote: ERROR in ./app/javascript/packs/application.js remote: Module build failed (from ./node_modules/babel-loader/lib/index.js): remote: Error: /tmp/build_32a448aa/babel.config.js: Configuration should be an exported JavaScript object. remote: at readConfigJS (/tmp/build_32a448aa/node_modules/@babel/core/lib/config/files/configuration.js:193:11) remote: at readConfigJS.next (<anonymous>) remote: at Function.<anonymous> (/tmp/build_32a448aa/node_modules/@babel/core/lib/gensync-utils/async.js:16:3) remote: at Generator.next (<anonymous>) remote: at step (/tmp/build_32a448aa/node_modules/gensync/index.js:261:32) remote: at evaluateAsync (/tmp/build_32a448aa/node_modules/gensync/index.js:291:5) remote: at Function.errback (/tmp/build_32a448aa/node_modules/gensync/index.js:113:7) remote: at errback (/tmp/build_32a448aa/node_modules/@babel/core/lib/gensync-utils/async.js:60:18) remote: at async (/tmp/build_32a448aa/node_modules/gensync/index.js:188:31) remote: at onFirstPause (/tmp/build_32a448aa/node_modules/gensync/index.js:216:13) remote: at Generator.next (<anonymous>) remote: at cachedFunction (/tmp/build_32a448aa/node_modules/@babel/core/lib/config/caching.js:58:46) remote: at cachedFunction.next (<anonymous>) remote: at step (/tmp/build_32a448aa/node_modules/gensync/index.js:269:25) remote: at evaluateAsync (/tmp/build_32a448aa/node_modules/gensync/index.js:291:5) remote: at /tmp/build_32a448aa/node_modules/gensync/index.js:44:11 remote: at Array.forEach (<anonymous>) remote: at Function.async (/tmp/build_32a448aa/node_modules/gensync/index.js:43:15) remote: at Function.all (/tmp/build_32a448aa/node_modules/gensync/index.js:216:13) remote: at Generator.next (<anonymous>) remote: at loadOneConfig (/tmp/build_32a448aa/node_modules/@babel/core/lib/config/files/configuration.js:108:34) remote: at loadOneConfig.next (<anonymous>) remote: at buildRootChain (/tmp/build_32a448aa/node_modules/@babel/core/lib/config/config-chain.js:68:51) remote: at buildRootChain.next (<anonymous>) remote: at loadPrivatePartialConfig (/tmp/build_32a448aa/node_modules/@babel/core/lib/config/partial.js:85:62) remote: at loadPrivatePartialConfig.next (<anonymous>) remote: at /tmp/build_32a448aa/node_modules/@babel/core/lib/config/partial.js:131:25 remote: at Generator.next (<anonymous>) remote: at step (/tmp/build_32a448aa/node_modules/gensync/index.js:269:25) remote: at evaluateAsync (/tmp/build_32a448aa/node_modules/gensync/index.js:291:5) remote: remote: remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile

(herokuのBildログ上でのエラー)

ERROR in ./app/javascript/packs/application.js Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: /tmp/build_c2f299eb/babel.config.js: Configuration should be an exported JavaScript object. at readConfigJS (/tmp/build_c2f299eb/node_modules/@babel/core/lib/config/files/configuration.js:193:11) at readConfigJS.next (<anonymous>) at Function.<anonymous> (/tmp/build_c2f299eb/node_modules/@babel/core/lib/gensync-utils/async.js:16:3) at Generator.next (<anonymous>) at step (/tmp/build_c2f299eb/node_modules/gensync/index.js:261:32) at evaluateAsync (/tmp/build_c2f299eb/node_modules/gensync/index.js:291:5) at Function.errback (/tmp/build_c2f299eb/node_modules/gensync/index.js:113:7) at errback (/tmp/build_c2f299eb/node_modules/@babel/core/lib/gensync-utils/async.js:60:18) at async (/tmp/build_c2f299eb/node_modules/gensync/index.js:188:31) at onFirstPause (/tmp/build_c2f299eb/node_modules/gensync/index.js:216:13) at Generator.next (<anonymous>) at cachedFunction (/tmp/build_c2f299eb/node_modules/@babel/core/lib/config/caching.js:58:46) at cachedFunction.next (<anonymous>) at step (/tmp/build_c2f299eb/node_modules/gensync/index.js:269:25) at evaluateAsync (/tmp/build_c2f299eb/node_modules/gensync/index.js:291:5) at /tmp/build_c2f299eb/node_modules/gensync/index.js:44:11 at Array.forEach (<anonymous>) at Function.async (/tmp/build_c2f299eb/node_modules/gensync/index.js:43:15) at Function.all (/tmp/build_c2f299eb/node_modules/gensync/index.js:216:13) at Generator.next (<anonymous>) at loadOneConfig (/tmp/build_c2f299eb/node_modules/@babel/core/lib/config/files/configuration.js:108:34) at loadOneConfig.next (<anonymous>) at buildRootChain (/tmp/build_c2f299eb/node_modules/@babel/core/lib/config/config-chain.js:68:51) at buildRootChain.next (<anonymous>) at loadPrivatePartialConfig (/tmp/build_c2f299eb/node_modules/@babel/core/lib/config/partial.js:85:62) at loadPrivatePartialConfig.next (<anonymous>) at /tmp/build_c2f299eb/node_modules/@babel/core/lib/config/partial.js:131:25 at Generator.next (<anonymous>) at step (/tmp/build_c2f299eb/node_modules/gensync/index.js:269:25) at evaluateAsync (/tmp/build_c2f299eb/node_modules/gensync/index.js:291:5) ! ! Precompiling assets failed. ! ! Push rejected, failed to compile Ruby app. ! Push failed

試したこと

エラー文を読むと原因は
【エラー: /tmp/build_c2f299eb/babel.config.js: 構成はエクスポートされた JavaScript オブジェクトである必要があります。】
とのことでしたのでエクスポートされていないことが原因だと思いました。

javasprict

1 2import '@fortawesome/fontawesome-free/js/all'; 3// This file is automatically compiled by Webpack, along with any other files 4// present in this directory. You're encouraged to place your actual application logic in 5// a relevant structure within app/javascript and only use these pack files to reference 6// that code so it'll be compiled. 7 8require("@rails/ujs").start() 9// require("turbolinks").start() 10require("channels") 11 12// Uncomment to copy all static images under ../images to the output folder and reference 13// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) 14// or the `imagePath` JavaScript helper below. 15// 16// const images = require.context('../images', true) 17// const imagePath = (name) => images(name, true) 18 19

(/app/javascript/packs/application.js)

ジャバスプリクト(/app/javascript/packs/application.js)の中身はこんな感じで特に問題ないと思います
Javaスプリクトの機能をつけようとしてうまくいかなかったものが残っていたので名前を削除して上記の記述になっています。
(かなり右往左往で弄っていて何かを消していたらすみません)

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

webpacker', '> 4.0'
ruby '2.6.5'
'rails', '
> 6.0.0'
Ruby on railsでアプリを作成しています。

原因がなんとなくしかわからず、わかりにくい質問になっていると感じていますが
もし何かお分かりになる方がいらっしゃいましたらご教授いただけると助かります。

よろしくお願いいたします。

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

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

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

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

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

guest

回答1

0

自己解決

webpackerをアンインストールしたらデプロイ通りました。
お騒がせしました。

投稿2021/06/24 02:23

pais

総合スコア1

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.47%

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

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

質問する

関連した質問