Home>

I get the following error when deploying to AWS

Tasks: TOP =>deploy: assets: precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: rake exit status: 1
rake stdout: yarn install v1.22.10
[1/4] Resolving packages ...
[2/4] Fetching packages ...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Compiling ...
Compilation failed:
yarn run v1.22.10
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

warning ../../package.json: No license field
warning ../../package.json: No license field
error Command "webpack" not found.


I have webpack installed, why does it happen?
HereOrHereI've tried various things, but it doesn't work
What could be the reason?
Professor please

node -v
v13.2.0
yarn -v
1.22.10
Files that are likely to be relevant

webpack.yml

# Note: You must restart bin/webpack-dev-server for changes to take effect
default:&default
  source_path: app/javascript
  source_entry_path: packs
  public_root_path: public
  public_output_path: packs
  cache_path: tmp/cache/webpacker
  webpack_compile_output: true
  #Additional paths webpack should lookup modules
  # ['app/assets','engine/foo/app/assets']
  additional_paths: []
  #Reload manifest.json on all requests so we reload latest compiled packs
  cache_manifest: false
  # Extract and emit a css file
  extract_css: false
  static_assets_extensions:
    --.jpg
    --.jpeg
    --.png
    --.gif
    --.tiff
    --.ico
    --.svg
    --.eot
    --.otf
    --.ttf
    --.woff
    --.woff2
  extensions: extensions:
    --.mjs
    --.js
    --.sass
    --.scss
    --.css
    --.module.sass
    --.module.scss
    --.module.css
    --.png
    --.svg
    --.gif
    --.jpeg
    --.jpg
development:
<<: * default
  compile: true
  #Reference: https://webpack.js.org/configuration/dev-server/
  dev_server:
    https: false
    host: localhost
    port: 3035
    public: localhost: 3035
    hmr: false
    #Inline should be set to true if using HMR
    inline: true
    overlay: true
    compress: true
    disable_host_check: true
    use_local_ip: false
    quiet: false
    pretty: false
    headers:
      'Access-Control-Allow-Origin':'*'
    watch_options:
      ignored:'**/node_modules/**'

test: test:
<<: * defaultcompile: true
  #Compile test packs to a separate directory
  public_output_path: packs-test
production:
<<: * default
  # Production depends on precompilation of packs prior to booting for performance.
  compile: false
  # Extract and emit a css file
  extract_css: true
  #Cache manifest.json for performance
  cache_manifest: true

Gemfile

source'https://rubygems.org'
git_source (: github) {| repo | "https://github.com/#{repo}.git"}
ruby '2.5.1'
# Bundle edge Rails instead: gem'rails', github:'rails/rails'
gem'rails','~>5.2.3'
#Use mysql as the database for Active Record
gem'mysql2', '0.5.2'
#Use Puma as the app server
gem'puma','~>3.11'
#Use SCSS for stylesheets
gem'sass-rails', '5.0.7'
#Use Uglifier as compressor for JavaScript assets
gem'uglifier','>= 1.3.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem'mini_racer', platforms :: ruby
#Use CoffeeScript for .coffee assets and views
gem'coffee-rails','~>4.2'
#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.5'
#Use Redis adapter to run Action Cable in production
# gem'redis','~>4.0'
# Use ActiveModel has_secure_password
# gem'bcrypt','~>3.1.7'
# Use ActiveStorage variant
# gem'mini_magick','~>4.8'
#Use Capistrano for deployment
# gem'capistrano-rails', group:: development
#Reduces boot times through caching;required in config/boot.rb
gem'bootsnap','>= 1.1.0', 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]
  gem'capistrano'
  gem'capistrano-rbenv'
  gem'capistrano-bundler'
  gem'capistrano-rails'
  gem'capistrano3-unicorn'
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'
  #Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  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 chromedriver to run system tests with Chrome
  gem'chromedriver-helper'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem'tzinfo-data', platforms: [: mingw,: mswin,: x64_mingw,: jruby]
gem'pry-rails'
gem'compass-rails', '3.1.0'
gem'sprockets', '3.7.2'
gem'kaminari'
gem'jquery-rails'
gem "jquery-ui-rails"
gem'full calendar-rails'
gem'momentjs-rails'
gem'rails-i18n'
gem'devise'
gem'carrierwave'
gem'mini_magick'
gem "font-awesome-sass"
gem'ancestry'
gem'fog'
gem'webpacker'
gem'bootstrap','~>5.0.0.alpha2'
group: production do
  gem'unicorn', '5.4.1'
end

package.json

{
  "name": "sample_boad",
  "private": true,
  "dependencies": {"@ rails/webpacker": "5.2.1",
    "vue": "^ 2.6.12",
    "vue-loader": "^ 15.9.5",
    "vue-template-compiler": "^ 2.6.12",
    "vuetify": "^ 2.3.17"
  },


  "devDependencies": {
    "webpack": "^ 4.44.2",
    "webpack-cli": "^ 3.3.12",
    "webpack-dev-server": "^ 3.11.0"
  },


  "babel": {
    "presets": [
      "./node_modules/@rails/webpacker/package/babel/preset.js"
    ]
  },


  "browserslist": [
    "defaults"
  ],,


  "description": "This README would normally document whatever steps are necessary to get the application up and running.",
  "version": "1.0.0",
  "main": "babel.config.js",
  "directories": {
    "lib": "lib",
    "test": "test"
  },


  "scripts": {
    "start": "webpack-dev-server",
    "test": "echo \" Error: no test specified \ "&&exit 1",
    "build": "webpack --mode development"
  },


  "repository": {
    "type": "git",
    "url": "git + https://github.com/katou02/baseball-app.git"
  },


  "keywords": [],


  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/katou02/baseball-app/issues"
  },


  "homepage": "https://github.com/katou02/baseball-app#readme"
}


bin/webpack

Hash: 0b1c0a20c88060441749
Version: webpack 4.44.2
Time: 3361ms
Built at: 2020/11/24 0:39:31
                                     Asset Size Chunks Chunk Names
    js/application-4f62ea677992947f725b.js 4.83 KiB application [emitted] [immutable] application
js/application-4f62ea677992947f725b.js.map 4.64 KiB application [emitted] [dev] application
      js/hello_vue-3eaaef18acbc2a0c9f27.js 3.26 MiB hello_vue [emitted] [immutable] hello_vue
  js/hello_vue-3eaaef18acbc2a0c9f27.js.map 3.64 MiB hello_vue [emitted] [dev] hello_vue
            js/top-443a173b319580692cec.js 3.9 KiB top [emitted] [immutable] top
        js/top-443a173b319580692cec.js.map 3.64 KiB top [emitted] [dev] top
                             manifest.json 972 bytes [emitted]
Entrypoint application = js/application-4f62ea677992947f725b.js js/application-4f62ea677992947f725b.js.map
Entrypoint hello_vue = js/hello_vue-3eaaef18acbc2a0c9f27.js js/hello_vue-3eaaef18acbc2a0c9f27.js.map
Entrypoint top = js/top-443a173b319580692cec.js js/top-443a173b319580692cec.js.map
[./app/javascript/app.vue] 339 bytes {hello_vue} [built] [failed] [1 error]
[./app/javascript/packs/application.js] 957 bytes {application} [built]
[./app/javascript/packs/hello_vue.js] 2.02 KiB {hello_vue} [built]
[./app/javascript/packs/top.js] 56 bytes {top} [built]
[./node_modules/webpack/buildin/global.js] (webpack) /buildin/global.js 905 bytes {hello_vue} [built]
[./node_modules/webpack/buildin/module.js] (webpack) /buildin/module.js 552 bytes {hello_vue} [built]
    + 9 hidden modules
ERROR in ./app/javascript/app.vue 1: 0
Module parse failed: Unexpected token (1: 0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
><template>|<v-app><!-Add->|<v-btn>​​Vuetify Button</v-btn>​​<!-Add->@ ./app/javascript/packs/hello_vue.js 10: 0-29 17: 15-18