お世話になります。
Rails Tutorialにて学習中です。
第8章最終の部分において、herokuへデプロイするのですが、
Precompiling assets failed.
とエラーが出てしまいます。
解決方法についてご教授願います。
以下、エラー内容となっております。
remote: Compilation failed: remote: /tmp/build_397464b6/config/webpack/environment.js:5 remote: new.webpack.ProvidePlugin({ remote: ^^^^^^^ remote: remote: SyntaxError: Unexpected identifier . . . remote: ! remote: ! Precompiling assets failed. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: ! remote: ! ## Warning - The same version of this code has already been built: cfb0dac017b63dbf1ec9ebf4f9c1b164731fbab8 remote: ! remote: ! We have detected that you have triggered a build from source code with version cfb0dac017b63dbf1ec9ebf4f9c1b164731fbab8 remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch. remote: ! remote: ! If you are developing on a branch and deploying via git you must run:
以下、エラーを引き起こしている(?)該当ファイルになります。
environment.js
environment.js
1const { environment } = require('@rails/webpacker') 2 3const webpack = require('webpack') 4environment.plugins.prepend('Provide', 5 new webpack.ProvidePlugin ( { 6 $: 'jquery/src/jquery', 7 jQuery: 'jquery/src/jquery' 8 } ) 9) 10 11module.exports = environment
application.js
application.js
1 2// This file is automatically compiled by Webpack, along with any other files 3// present in this directory. You're encouraged to place your actual application logic in 4// a relevant structure within app/javascript and only use these pack files to reference 5// that code so it'll be compiled. 6 7import Rails from "@rails/ujs" 8import Turbolinks from "turbolinks" 9import * as ActiveStorage from "@rails/activestorage" 10import "channels" 11 12Rails.start() 13Turbolinks.start() 14ActiveStorage.start()
あなたの回答
tips
プレビュー