前提・実現したいこと
【結論】
railsアプリ作成中で、herokuでデプロイをしたいのですが、
「git push heroku master]を入力すると、下記エラーが出てしまいデプロイができない状況です。
『 ModuleNotFoundError: Module not found: Error: Can't resolve 'chartkick/chart.js' in '/tmp/build_a2d4dafc/app/javascript/packs'』
ここの部分が怪しいと思いましたが原因と解決には至りませんでした。
色んなサイトにて調べましたが全く解決をしないのでご質問させていただきます。
発生している問題・エラーメッセージ
remote: The "loose" option must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled): you can silence this warning by explicitly adding remote: ["@babel/plugin-proposal-private-methods", { "loose": true }] remote: to the "plugins" section of your Babel config. remote: ModuleNotFoundError: Module not found: Error: Can't resolve 'chartkick/chart.js' in '/tmp/build_a2d4dafc/app/javascript/packs' remote: at /tmp/build_a2d4dafc/node_modules/webpack/lib/Compilation.js:925:10
remote: ["@babel/plugin-proposal-private-methods", { "loose": true }] remote: to the "plugins" section of your Babel config. remote: remote: 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: eef04d6f571fd2031eb688b698dcec7ec9ec54bc
該当のソースコード
ソースコード
試したこと
・「yarn add chartkick chart.js」コマンド入力 (エラーでできない)
・アプリの再作成
・「npm install ng2-charts chart.js --save 」コマンド入力
補足情報(FW/ツールのバージョンなど)
ruby 2.6.8p205 (2021-07-07 revision 67951) [x86_64-darwin20]
Rails 6.0.4.1
ruby '2.6.8'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 6.0.0' # Use mysql as the database for Active Record gem 'mysql2', '~>0.5.3' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '~> 5' # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker gem 'webpacker', '~> 4.0' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.7' gem 'bootsnap', '>= 1.4.2', require: false group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen', '>= 3.0.5', '< 3.2' gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of web drivers to run system tests with browsers gem 'webdrivers' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] group :development do gem 'rubocop', require: false end gem 'pry-rails' gem 'devise' gem 'active_hash' gem 'chartkick'
あなたの回答
tips
プレビュー