noi-techpark / odh-mentor-otp

5 stars 8 forks source link

As an Open Data Hub OTP maintainer I want to get the MVP using otp-react-redux working in our environment. #207

Closed clezag closed 6 days ago

clezag commented 1 week ago

After merging PR https://github.com/noi-techpark/odh-mentor-otp/pull/206, I'm unable to start the web-demo locally. Related to #190

To reproduce:

git clone --recurse-submodules git@github.com:noi-techpark/odh-mentor-otp.git
cd odh-mentor-otp/web-demo
yarn start

Application starts with error page:

Error
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.
Call Stack
 resolveDispatcher
  lib/vendor/otp-react-redux/node_modules/react/cjs/react.development.js:1465:13
 useMemo
  lib/vendor/otp-react-redux/node_modules/react/cjs/react.development.js:1520:20
 ConnectFunction
  lib/vendor/otp-react-redux/node_modules/react-redux/es/components/connectAdvanced.js:231:75
 renderWithHooks
  node_modules/react-dom/cjs/react-dom.development.js:14803:27
 updateFunctionComponent
  node_modules/react-dom/cjs/react-dom.development.js:17034:20
 updateSimpleMemoComponent
  node_modules/react-dom/cjs/react-dom.development.js:16972:10
 updateMemoComponent
  node_modules/react-dom/cjs/react-dom.development.js:16861:14
 beginWork
  node_modules/react-dom/cjs/react-dom.development.js:18682:16
 callCallback
  node_modules/react-dom/cjs/react-dom.development.js:188:14
 invokeGuardedCallbackDev
  node_modules/react-dom/cjs/react-dom.development.js:237:16

What am I missing?

rcavaliere commented 1 week ago

@ch-routerank can you please provide a feedback to @clezag so that we can proceed with the integration in our infrastructure?

ch-routerank commented 1 week ago

Hello @clezag I could indeed reproduce this on a fresh environment. We've identified a fix that would make the deployment a bit cleaner but involves a small change in the base otp-react-redux library.

I'll submit a PR to the otp-react-redux fork in the organisation and we can then propose it upstream.