Skip to content

Not install client/package.json when deploying Heroku #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
koansang opened this issue Aug 8, 2018 · 1 comment
Closed

Not install client/package.json when deploying Heroku #441

koansang opened this issue Aug 8, 2018 · 1 comment

Comments

@koansang
Copy link

koansang commented Aug 8, 2018

I want deploy heroky. but not installed dependency in client/package.json.
This my code:

clent/package.json

{
  "name": "myrealtrip-client",
  "version": "0.1.0",
  "homepage": ".",
  "private": true,
  "dependencies": {
    "@rails/webpacker": "4.0.0-pre.2",
    "axios": "^0.18.0",
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-object-rest-spread": "^6.26.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-polyfill": "^6.26.0",
    "babel-preset-react": "^6.24.1",
    "babel-preset-stage-1": "^6.24.1",
    "babel-runtime": "^6.26.0",
    "core-js": "^2.5.7",
    "css-loader": "^1.0.0",
    "extract-text-webpack-plugin": "^4.0.0-beta.0",
    "file-loader": "^1.1.11",
    "i18next": "^11.5.0",
    "i18next-browser-languagedetector": "^2.2.2",
    "js-cookie": "^2.2.0",
    "lodash": "^4.17.10",
    "moment-timezone": "^0.5.21",
    "node-sass": "^4.9.2",
    "postcss-loader": "^2.1.6",
    "prop-types": "^15.6.2",
    "react": "^16.4.1",
    "react-dom": "^16.4.1",
    "react-hot-loader": "^4.3.3",
    "react-id-swiper": "^1.6.6",
    "react-on-rails": "11.0.9",
    "resolve-url-loader": "^2.3.0",
    "sass-loader": "^7.1.0",
    "style-loader": "^0.21.0",
    "swiper": "^4.3.3",
    "url-loader": "^1.0.1",
    "webpack": "4.8.3",
    "webpack-cli": "^3.1.0",
    "webpack-manifest-plugin": "^2.0.3",
    "webpack-merge": "^4.1.3"
  },
  "scripts": {
    "test": "react-scripts test --env=jsdom",
    "build": "webpack -p --env.env=prod",
    "build:flight": "webpack -p --config webpack.flight.js",
    "start": "webpack-dev-server --hot --env.env=dev",
    "upload": "node aws/uploader.js"
  },
  "devDependencies": {
    "aws-sdk": "^2.286.2",
    "clean-webpack-plugin": "^0.1.19",
    "cross-env": "^5.2.0",
    "html-webpack-plugin": "^3.2.0",
    "raf": "^3.4.0",
    "webpack-dev-server": "^3.1.5"
  }
}

react_on_rails.rb

ReactOnRails.configure do |config|
  config.node_modules_location = "client"

  config.build_production_command = "RAILS_ENV=production NODE_ENV=production yarn run build"
  config.webpack_generated_files = %w[ app.js vendor.js app.css vendor.css ]

  config.trace = Rails.env.development?

  config.development_mode = Rails.env.development?
  config.build_test_command = "RAILS_ENV=test bin/webpack"
end

Error message

cd "client" && RAILS_ENV=production NODE_ENV=production yarn run build
       yarn run v1.9.4
       warning ../package.json: No license field
       $ webpack -p --env.env=prod
       module.js:549
           throw err;
           ^
       
       Error: Cannot find module 'webpack-manifest-plugin'
           at Function.Module._resolveFilename (module.js:547:15)
           at Function.Module._load (module.js:474:25)
           at Module.require (module.js:596:17)
           at require (internal/module.js:11:18)
           at Object.<anonymous> (/tmp/build_bb0a86b823333beb6ef1357016e56909/client/config/webpack.common.js:2:24)
           at Module._compile (module.js:652:30)
           at Object.Module._extensions..js (module.js:663:10)
           at Module.load (module.js:565:32)
           at tryModuleLoad (module.js:505:12)
           at Function.Module._load (module.js:497:3)
       error Command failed with exit code 1.
       info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
       rake aborted!
       Command failed with status (1): [cd "client" && RAILS_ENV=production NODE_E...]
       /tmp/build_bb0a86b823333beb6ef1357016e56909/vendor/bundle/ruby/2.3.0/gems/react_on_rails-11.0.9/lib/tasks/assets.rake:64:in `block (3 levels) in <top (required)>'
       /tmp/build_bb0a86b823333beb6ef1357016e56909/vendor/bundle/ruby/2.3.0/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
       Tasks: TOP => assets:precompile => react_on_rails:assets:compile_environment => react_on_rails:assets:webpack
@justin808
Copy link
Member

@koansang focus on the error message.

If you need personal debugging help, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants