Version of browser: 1.25.73 Chromium: 91.0.4472.106 (Official Build)
Version of geist-ui/react: 2.1.5
Version of react: 17.0.2
Version of next: 11.0.1
Expected Behaviour
The behavior I expect is I should be able to launch next.js dev mode with next dev without getting an invalid hook call error when it compiles the page.
Actual results (or Errors)
I get an invalid hook call error on page compilation from the GeistProvider and CSSBaseline higher order components.
I got an error:
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.
at resolveDispatcher (/home/max/dev/dagcord/frontend/node_modules/@geist-ui/react/node_modules/react/cjs/react.development.js:1465:13)
at useState (/home/max/dev/dagcord/frontend/node_modules/@geist-ui/react/node_modules/react/cjs/react.development.js:1496:20)
at useCurrentState (/home/max/dev/dagcord/frontend/node_modules/@geist-ui/react/dist/index.js:962:73)
at GeistProvider (/home/max/dev/dagcord/frontend/node_modules/@geist-ui/react/dist/index.js:781:98)
at processChild (/home/max/dev/dagcord/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
at resolve (/home/max/dev/dagcord/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
at ReactDOMServerRenderer.render (/home/max/dev/dagcord/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
at ReactDOMServerRenderer.read (/home/max/dev/dagcord/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
at renderToString (/home/max/dev/dagcord/frontend/node_modules/react-dom/cjs/react-dom-server.node.development.js:4298:27)
at Object.renderPage (/home/max/dev/dagcord/frontend/node_modules/next/dist/next-server/server/render.js:53:854)
The canary version solves this issue.
If you do not want to include breaking upgrades, use the 2.2.0-canary.6, the latest canary version is 2.2.0-canary.7.
Bug report 🐞
Version & Environment
1.25.73 Chromium: 91.0.4472.106 (Official Build)
geist-ui/react
:2.1.5
react
:17.0.2
next
:11.0.1
Expected Behaviour
The behavior I expect is I should be able to launch next.js dev mode with
next dev
without getting aninvalid hook call
error when it compiles the page.Actual results (or Errors)
I get an invalid hook call error on page compilation from the
GeistProvider
andCSSBaseline
higher order components.I got an error:
Files
_app.tsx
:_document.tsx
(copied from the geist-ui example for next.