shakacode / react_on_rails

Integration of React + Webpack + Rails + rails/webpacker including server-side rendering of React, enabling a better developer experience and faster client performance.
https://www.shakacode.com/react-on-rails/docs/
MIT License
5.11k stars 629 forks source link

Cannot find module 'redux' or its correspondsing declarations #1321

Closed markdthompson-SR closed 4 years ago

markdthompson-SR commented 4 years ago

We're upgrading to 11.3.0 to 12.0.1 and are getting the following error in our production build: Screen Shot 2020-08-24 at 2 20 02 PM

Can you advise as to this issue?

Here's our package.json:

{ "name": "farmserver", "private": true, "sideEffects": false, "scripts": { "start": "foreman start -f Procfile.dev-server", "test": "NODE_ENV=test jest --watch --coverage", "test-ci": "NODE_ENV=test jest --maxWorkers=2", "test:generate-output": "jest --json --outputFile=jest-test-results.json", "test-debug": "node --inspect-brk node_modules/.bin/jest --runInBand", "storybook": "start-storybook -p 6006 -s app/assets/fonts", "build-storybook": "build-storybook", "generate-graphql-schema": "rake graphql:dump_schema && gql2ts ./app/graphql/schema.json --ignore-type-name-declaration -o ./app/javascript/bundles/graphql/schema.d.ts -e ../../../app/javascript/bundles/graphql/conversionConfig.js && rake graphql:generate_fragment_matcher && yarn eslint --fix ./app/javascript/bundles/graphql/schema.d.ts", "profile-webpack": "RAILS_ENV=production NODE_ENV=production bin/webpack --profile --json > stats.json && node_modules/.bin/webpack-bundle-analyzer stats.json", "typescript": "tsc --noEmit", "lint": "eslint './app/*/.{js,ts,tsx}'" }, "dependencies": { "@apollo/react-testing": "^3.1.4", "@babel/core": "^7.9.0", "@babel/plugin-proposal-class-properties": "^7.4.4", "@babel/plugin-proposal-export-default-from": "^7.2.0", "@babel/plugin-proposal-object-rest-spread": "^7.4.4", "@babel/plugin-syntax-dynamic-import": "^7.2.0", "@babel/plugin-transform-runtime": "^7.4.4", "@babel/preset-env": "^7.9.0", "@babel/preset-flow": "^7.0.0", "@babel/preset-react": "^7.0.0", "@babel/runtime": "^7.9.0", "@rails/webpacker": "^4.2.0", "@sentry/browser": "^5.20.0", "@types/enzyme": "^3.10.5", "@types/jest": "^26.0.5", "@types/node-sass": "^4.11.0", "@types/react": "^16.9.31", "@types/react-dom": "^16.9.6", "@types/sinon": "^9.0.0", "@types/webpack-env": "^1.15.2", "actioncable": "^5.2.4-1", "apollo-cache": "^1.3.2", "apollo-cache-inmemory": "^1.6.3", "apollo-client": "^2.6.4", "apollo-link": "^1.2.13", "apollo-link-error": "^1.1.12", "apollo-link-http": "^1.5.16", "apollo-link-rest": "^0.7.3", "apollo-link-state": "^0.4.2", "apollo-upload-client": "14.1.0", "apollo-utilities": "^1.3.2", "babel-core": "^6.26.3", "caniuse-lite": "^1.0.30001105", "classnames": "^2.2.6", "css-loader": "^3.2.1", "enzyme-to-json": "^3.4.3", "events": "^3.2.0", "file-loader": "^6.0.0", "graphql": "^14.5.8", "graphql-anywhere": "^4.2.6", "graphql-ruby-client": "^1.7.6", "graphql-tag": "^2.10.3", "history": "^4.10.1", "imagemin": "^6.1.0", "img-loader": "^3.0.1", "js-yaml": "^3.13.1", "lodash-webpack-plugin": "^0.11.5", "lodash.isequal": "^4.5.0", "lodash.omit": "^4.5.0", "moment": "^2.24.0", "postcss-cssnext": "^3.1.0", "postcss-import": "^12.0.1", "postcss-loader": "^3.0.0", "qs": "^6.9.1", "query-string": "^6.11.1", "react": "~16.13.0", "react-apollo": "^3.1.4", "react-dates": "^21.5.0", "react-dom": "~16.13.0", "react-html5-camera-photo": "^1.5.4", "react-modal": "^3.11.2", "react-on-rails": "^12.0.1", "react-portal": "^4.2.0", "react-router-dom": "^5.1.2", "react-select": "^3.0.8", "react-tabs": "^3.0.0", "react-tooltip": "^4.1.2", "react-with-direction": "^1.3.1", "regenerator-runtime": "^0.13.6", "reselect": "^4.0.0", "sass-loader": "^9.0.2", "subscriptions-transport-ws": "^0.9.17", "ts-loader": "^8.0.1", "typescript": "^3.9.7", "url-loader": "^4.0.0", "victory": "^35.0.5", "webpack": "^4.42.0", "webpack-cli": "^3.3.11", "webpack-merge": "^5.0.9" }, "devDependencies": { "@babel/preset-typescript": "^7.9.0", "@gql2ts/language-typescript": "^1.9.0", "@sambego/storybook-state": "^2.0.1", "@storybook/addon-actions": "^5.3.17", "@storybook/addon-jest": "^5.3.17", "@storybook/addon-knobs": "^5.3.17", "@storybook/addon-links": "^5.3.17", "@storybook/addons": "^5.3.17", "@storybook/core": "^5.3.17", "@storybook/react": "^5.3.17", "@typescript-eslint/eslint-plugin": "^3.7.0", "@typescript-eslint/parser": "^3.7.0", "babel-eslint": "^10.1.0", "babel-jest": "^26.1.0", "babel-loader": "^8.0.6", "babel-plugin-dynamic-import-node": "^2.2.0", "enzyme": "^3.10.0", "enzyme-adapter-react-16": "^1.15.1", "eslint": "^7.5.0", "eslint-config-airbnb": "^18.1.0", "eslint-config-airbnb-base": "^14.1.0", "eslint-loader": "^4.0.2", "eslint-plugin-import": "^2.18.2", "eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-promise": "^4.1.1", "eslint-plugin-react": "^7.19.0", "eslint-plugin-react-hooks": "^4.0.8", "extract-text-webpack-plugin": "^4.0.0-beta.0", "gql2ts": "^1.10.1", "identity-obj-proxy": "^3.0.0", "jest": "^26.1.0", "jest-localstorage-mock": "2.4.3", "jest-runner-eslint": "^0.10.0", "prop-types": "^15.0.0-0", "sinon": "^9.0.1", "webpack-bundle-analyzer": "^3.6.1", "webpack-dev-server": "^3.9.0" }, "jest": { "testURL": "http://localhost/" } }

justin808 commented 4 years ago

This looks like a legit issue. I'm investigating, @markdthompson-SR.

justin808 commented 4 years ago

A very quick workaround would be to add redux. However, I'm going to ensure that this is not needed in the longer term.

justin808 commented 4 years ago

@markdthompson-SR Please confirm that 12.0.2 fixes your reported issue.

markdthompson-SR commented 4 years ago

Hey Justin - yep, 12.0.2 fixed the reported issue.

On Tue, Aug 25, 2020 at 10:28 PM Justin Gordon notifications@github.com wrote:

@markdthompson-SR https://github.com/markdthompson-SR Please confirm that 12.0.2 fixes your reported issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shakacode/react_on_rails/issues/1321#issuecomment-680422845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP4MEGIQ67TFVYHWDX3H3STSCRXOHANCNFSM4QJZFYSA .

--

Mark D Thompson

Square Roots | Full Stack Software Engineer

squarerootsgrow.com http://www.squarerootsgrow.com/

Instagram https://www.instagram.com/squarerootsgrow/?hl=en | Facebook https://www.facebook.com/squarerootsgrow/ | Twitter https://twitter.com/squarerootsgrow?lang=en

Sign up for our newsletter https://squarerootsgrow.us14.list-manage.com/subscribe/post?u=f3a64b5cc3c0668f47fd2fe34&id=e236a352ee !

An indoor urban farming company,

connecting people in cities to local, real food.

markdthompson-SR commented 4 years ago

Hello Justin,

Although the 12.0.2 fix update resolved the redux issue, we're now experiencing an issue with es-lint-loader. Any insights would be greatly appreciated. Here's a fragment of our build log:


   Email contact@shakacode.com for access to our slack room and

information about our "pro support plan"

   which supports better performance, via caching helpers and our node

rendering server.


   Removing bundler (2.0.2)

   Removing react_on_rails (11.3.0)

   Bundle completed (3.76s)

   Cleaning up the bundler cache.

-----> Detecting rake tasks

-----> Preparing app for Rails asset pipeline

   Running: rake assets:precompile

   I, [2020-08-26T17:19:26.575434 #3067]  INFO -- : Raven 3.0.0 ready

to catch errors

   Compiling...

   Compilation failed:

   Hash: ba766e1ad7d2daae682d

   Version: webpack 4.44.0

   Time: 56ms

   Built at: 08/26/2020 5:19:32 PM

   ERROR in Entry module not found: Error: Can't resolve

'eslint-loader' in '/tmp/build2266bbd1'

   ERROR in Entry module not found: Error: Can't resolve

'eslint-loader' in '/tmp/build2266bbd1'

   Insufficient number of arguments or no entry found.

   Alternatively, run 'webpack(-cli) --help' for usage info.

!

! Precompiling assets failed.

!

! Push rejected, failed to compile Ruby app.

! Push failed

best regards

On Wed, Aug 26, 2020 at 9:02 PM Mark Thompson < mark.thompson@squarerootsgrow.com> wrote:

Hey Justin - yep, 12.0.2 fixed the reported issue.

On Tue, Aug 25, 2020 at 10:28 PM Justin Gordon notifications@github.com wrote:

@markdthompson-SR https://github.com/markdthompson-SR Please confirm that 12.0.2 fixes your reported issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shakacode/react_on_rails/issues/1321#issuecomment-680422845, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP4MEGIQ67TFVYHWDX3H3STSCRXOHANCNFSM4QJZFYSA .

--

Mark D Thompson

Square Roots | Full Stack Software Engineer

squarerootsgrow.com http://www.squarerootsgrow.com/

Instagram https://www.instagram.com/squarerootsgrow/?hl=en | Facebook https://www.facebook.com/squarerootsgrow/ | Twitter https://twitter.com/squarerootsgrow?lang=en

Sign up for our newsletter https://squarerootsgrow.us14.list-manage.com/subscribe/post?u=f3a64b5cc3c0668f47fd2fe34&id=e236a352ee !

An indoor urban farming company,

connecting people in cities to local, real food.

--

Mark D Thompson

Square Roots | Full Stack Software Engineer

squarerootsgrow.com http://www.squarerootsgrow.com/

Instagram https://www.instagram.com/squarerootsgrow/?hl=en | Facebook https://www.facebook.com/squarerootsgrow/ | Twitter https://twitter.com/squarerootsgrow?lang=en

Sign up for our newsletter https://squarerootsgrow.us14.list-manage.com/subscribe/post?u=f3a64b5cc3c0668f47fd2fe34&id=e236a352ee !

An indoor urban farming company,

connecting people in cities to local, real food.

justin808 commented 4 years ago

Hi @markdthompson-SR, I recommend a few things:

  1. Join our React Rails Slack with this invite.
  2. Create a small reproduction by forking https://github.com/shakacode/react_on_rails_tutorial_with_ssr_and_hmr_fast_refresh and adding the eslint-loader
  3. Report back in a new, opened issue

And feel free to contact me directly: justin@shakacode.com