@@ -39,6 +39,7 @@ Example app code available here: https://github.com/BookOfGreg/react-rails-examp
3939 - [ Camelize Props] ( #camelize-props )
4040- [ Upgrading] ( #upgrading )
4141 - [ 2.3 to 2.4] ( #23-to-24 )
42+ - [ Common Errors] ( #common-errors )
4243- [ Related Projects] ( #related-projects )
4344- [ Contributing] ( #contributing )
4445
@@ -83,7 +84,7 @@ This gives you:
8384
84854 ) Link the JavaScript pack in Rails view using ` javascript_pack_tag ` [ helper] ( https://github.com/rails/webpacker#usage ) , for example:
8586```
86- <!-- application.html.erb in Head tag below turbolinks-->
87+ <!-- application.html.erb in Head tag below turbolinks -->
8788<%= javascript_pack_tag 'application' %>
8889```
8990
@@ -101,7 +102,8 @@ Note: Your component is added to `app/javascript/components/` by default.
101102
1021037 ) [ Render it in a Rails view] ( #view-helper ) :
103104
104- ``` erb: paste this in view
105+ ```
106+ <!-- erb: paste this in view -->
105107<%= react_component("HelloWorld", { greeting: "Hello from react-rails." }) %>
106108```
107109
@@ -587,6 +589,31 @@ For the vast majority of cases this will get you most of the migration:
587589- add ` import PropTypes from 'prop-types' ` (Webpacker only)
588590- re-run ` bundle exec rails webpacker:install:react ` to update npm packages (Webpacker only)
589591
592+ ## Common Errors
593+ 1 ) While using installers.(rails webpacker:install: react && rails webpacker: install )
594+ Error:
595+ ```
596+ public/packs/manifest.json. Possible causes:
597+ 1. You want to set webpacker.yml value of compile to true for your environment
598+ unless you are using the `webpack -w` or the webpack-dev-server.
599+ 2. webpack has not yet re-run to reflect updates.
600+ 3. You have misconfigured Webpacker's config/webpacker.yml file.
601+ 4. Your webpack configuration is not creating a manifest.
602+ or
603+ yarn: error: no such option: --dev
604+ ERROR: [Errno 2] No such file or directory: 'add'
605+ ```
606+ Fix: Try updating yarn package.
607+ ```
608+ sudo apt remove cmdtest
609+ sudo apt remove yarn
610+ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
611+ echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
612+ sudo apt-get update && sudo apt-get install yarn
613+
614+ yarn install
615+ ```
616+
590617## Related Projects
591618
592619- [ webpacker-react] ( https://github.com/renchap/webpacker-react ) : Integration of React with Rails utilizing Webpack with Hot Module Replacement (HMR).
0 commit comments