vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.51k stars 26.81k forks source link

[Example Bug] | MDB-React | create-next-app outputs errors #24925

Open John4266 opened 3 years ago

John4266 commented 3 years ago

What example does this report relate to?

with-mdbreact-app

What version of Next.js are you using?

10.2.0

What version of Node.js are you using?

15.8.0

What browser are you using?

Firefox

What operating system are you using?

Windows 10

How are you deploying your application?

create-next-app

Describe the Bug

Whenever i try to run the example of mdbreact using npx create-next-app --example with-mdbreact with-mdbreact-app, i receive the following output:

Creating a new Next.js app in D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app.

Downloading files for example with-mdbreact. This might take a moment.

Installing packages. This might take a couple of minutes.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR!   peer react@"*" from mdbreact@5.0.2
npm ERR!   node_modules/mdbreact
npm ERR!     mdbreact@"^5.0.0" from the root project
npm ERR!   2 more (react-dom, next)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.3.0" from @material-ui/core@3.9.3
npm ERR! node_modules/mdbreact/node_modules/@material-ui/core
npm ERR!   @material-ui/core@"3.9.3" from mdbreact@5.0.2
npm ERR!   node_modules/mdbreact
npm ERR!     mdbreact@"^5.0.0" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Win10\AppData\Local\npm-cache\_logs\2021-05-09T06_32_12_044Z-debug.log

Aborting installation.
  npm install --loglevel error has failed.

Expected Behavior

It should just install the dependencies i guess with no errors.

To Reproduce

Just run npx create-next-app --example with-mdbreact with-mdbreact-app

insivika commented 3 years ago

@John4266 did you figure this out?

John4266 commented 3 years ago

@John4266 did you figure this out?

I just tried again and ended up with different results. Unfortunately, this is still not working properly.

$ npm run dev

> dev
> next dev

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info  - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
event - compiled successfully
event - build page: /
wait  - compiling...
event - build page: /next/dist/pages/_error
event - compiled successfully
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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
ScottJr commented 3 years ago

Same here. I'm on Windows 10 as well. If I add the --legacy-peer-deps option to the npm install, the error goes away.

github-actions[bot] commented 1 year ago

Please verify that your issue can be recreated with next@canary.

Why was this issue marked with the please verify canary label?

We noticed the provided reproduction was using an older version of Next.js, instead of canary.

The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. You can think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running npm install next@canary and test it in your project, using your reproduction steps.

If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.

How can I quickly verify if my issue has been fixed in canary?

The safest way is to install next@canary in your project and test it, but you can also search through closed Next.js issues for duplicates or check the Next.js releases.

My issue has been open for a long time, why do I need to verify canary now?

Next.js does not backport bug fixes to older versions of Next.js. Instead, we are trying to introduce only a minimal amount of breaking changes between major releases.

What happens if I don't verify against the canary version of Next.js?

An issue with the please verify canary that receives no meaningful activity (e.g. new comments that acknowledge verification against canary) will be automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue, with the required reproduction, using next@canary.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

John4266 commented 1 year ago

I just tried to install the mdbreact example again using npx create-next-app --example with-mdbreact with-mdbreact-app but ended up with the same problem at https://github.com/vercel/next.js/issues/24925#issuecomment-915384815

At first I received many warnings but no errors (yet):

npx create-next-app --example with-mdbreact with-mdbreact-app ``` PS D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs> npx create-next-app --example with-mdbreact with-mdbreact-app Need to install the following packages: create-next-app@13.0.5 Ok to proceed? (y) y Creating a new Next.js app in D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app. Downloading files for example with-mdbreact. This might take a moment. Installing packages. This might take a couple of minutes. npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @material-ui/core@3.9.3 npm WARN Found: react@17.0.1 npm WARN node_modules/mdbreact/node_modules/react npm WARN peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^16.3.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN @material-ui/core@"3.9.3" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN 1 more (material-ui-pickers) npm WARN npm WARN Conflicting peer dependency: react@16.14.0 npm WARN node_modules/react npm WARN peer react@"^16.3.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN @material-ui/core@"3.9.3" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN 1 more (material-ui-pickers) npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: @material-ui/core@3.9.3 npm WARN Found: react-dom@17.0.1 npm WARN node_modules/mdbreact/node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^16.3.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN @material-ui/core@"3.9.3" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN 1 more (material-ui-pickers) npm WARN npm WARN Conflicting peer dependency: react-dom@16.14.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN @material-ui/core@"3.9.3" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN 1 more (material-ui-pickers) npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: focus-trap-react@6.0.0 npm WARN Found: react@17.0.1 npm WARN node_modules/mdbreact/node_modules/react npm WARN peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"0.14.x || ^15.0.0 || ^16.0.0" from focus-trap-react@6.0.0 npm WARN node_modules/mdbreact/node_modules/focus-trap-react npm WARN focus-trap-react@"^6.0.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react@16.14.0 npm WARN node_modules/react npm WARN peer react@"0.14.x || ^15.0.0 || ^16.0.0" from focus-trap-react@6.0.0 npm WARN node_modules/mdbreact/node_modules/focus-trap-react npm WARN focus-trap-react@"^6.0.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: focus-trap-react@6.0.0 npm WARN Found: react-dom@17.0.1 npm WARN node_modules/mdbreact/node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"0.14.x || ^15.0.0 || ^16.0.0" from focus-trap-react@6.0.0 npm WARN node_modules/mdbreact/node_modules/focus-trap-react npm WARN focus-trap-react@"^6.0.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react-dom@16.14.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"0.14.x || ^15.0.0 || ^16.0.0" from focus-trap-react@6.0.0 npm WARN node_modules/mdbreact/node_modules/focus-trap-react npm WARN focus-trap-react@"^6.0.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: material-ui-pickers@2.2.4 npm WARN Found: react@17.0.1 npm WARN node_modules/mdbreact/node_modules/react npm WARN peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^16.3.0" from material-ui-pickers@2.2.4 npm WARN node_modules/mdbreact/node_modules/material-ui-pickers npm WARN material-ui-pickers@"2.2.4" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react@16.14.0 npm WARN node_modules/react npm WARN peer react@"^16.3.0" from material-ui-pickers@2.2.4 npm WARN node_modules/mdbreact/node_modules/material-ui-pickers npm WARN material-ui-pickers@"2.2.4" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: material-ui-pickers@2.2.4 npm WARN Found: react-dom@17.0.1 npm WARN node_modules/mdbreact/node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^16.3.0" from material-ui-pickers@2.2.4 npm WARN node_modules/mdbreact/node_modules/material-ui-pickers npm WARN material-ui-pickers@"2.2.4" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react-dom@16.14.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from material-ui-pickers@2.2.4 npm WARN node_modules/mdbreact/node_modules/material-ui-pickers npm WARN material-ui-pickers@"2.2.4" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-chartjs-2@2.9.0 npm WARN Found: react@17.0.1 npm WARN node_modules/mdbreact/node_modules/react npm WARN peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^0.14.0 || ^15.0.0 || ^16.0.0-beta || ^16.0.0" from react-chartjs-2@2.9.0 npm WARN node_modules/mdbreact/node_modules/react-chartjs-2 npm WARN react-chartjs-2@"2.9.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react@16.14.0 npm WARN node_modules/react npm WARN peer react@"^0.14.0 || ^15.0.0 || ^16.0.0-beta || ^16.0.0" from react-chartjs-2@2.9.0 npm WARN node_modules/mdbreact/node_modules/react-chartjs-2 npm WARN react-chartjs-2@"2.9.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-chartjs-2@2.9.0 npm WARN Found: react-dom@17.0.1 npm WARN node_modules/mdbreact/node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^0.14.0 || ^15.0.0 || ^16.0.0-beta || ^16.0.0" from react-chartjs-2@2.9.0 npm WARN node_modules/mdbreact/node_modules/react-chartjs-2 npm WARN react-chartjs-2@"2.9.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react-dom@16.14.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"^0.14.0 || ^15.0.0 || ^16.0.0-beta || ^16.0.0" from react-chartjs-2@2.9.0 npm WARN node_modules/mdbreact/node_modules/react-chartjs-2 npm WARN react-chartjs-2@"2.9.0" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-image-lightbox@5.1.1 npm WARN Found: react@17.0.1 npm WARN node_modules/mdbreact/node_modules/react npm WARN peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^16.x" from react-image-lightbox@5.1.1 npm WARN node_modules/mdbreact/node_modules/react-image-lightbox npm WARN react-image-lightbox@"5.1.1" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react@16.14.0 npm WARN node_modules/react npm WARN peer react@"^16.x" from react-image-lightbox@5.1.1 npm WARN node_modules/mdbreact/node_modules/react-image-lightbox npm WARN react-image-lightbox@"5.1.1" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-image-lightbox@5.1.1 npm WARN Found: react-dom@17.0.1 npm WARN node_modules/mdbreact/node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^16.x" from react-image-lightbox@5.1.1 npm WARN node_modules/mdbreact/node_modules/react-image-lightbox npm WARN react-image-lightbox@"5.1.1" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react-dom@16.14.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"^16.x" from react-image-lightbox@5.1.1 npm WARN node_modules/mdbreact/node_modules/react-image-lightbox npm WARN react-image-lightbox@"5.1.1" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-scroll@1.7.16 npm WARN Found: react@17.0.1 npm WARN node_modules/mdbreact/node_modules/react npm WARN peer react@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^15.5.4 || ^16.0.0" from react-scroll@1.7.16 npm WARN node_modules/mdbreact/node_modules/react-scroll npm WARN react-scroll@"1.7.16" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react@16.14.0 npm WARN node_modules/react npm WARN peer react@"^15.5.4 || ^16.0.0" from react-scroll@1.7.16 npm WARN node_modules/mdbreact/node_modules/react-scroll npm WARN react-scroll@"1.7.16" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: react-scroll@1.7.16 npm WARN Found: react-dom@17.0.1 npm WARN node_modules/mdbreact/node_modules/react-dom npm WARN peer react-dom@"^16.3.0" from @material-ui/system@3.0.0-alpha.2 npm WARN node_modules/mdbreact/node_modules/@material-ui/core/node_modules/@material-ui/system npm WARN @material-ui/system@"^3.0.0-alpha.0" from @material-ui/core@3.9.3 npm WARN node_modules/mdbreact/node_modules/@material-ui/core npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^15.5.4 || ^16.0.0" from react-scroll@1.7.16 npm WARN node_modules/mdbreact/node_modules/react-scroll npm WARN react-scroll@"1.7.16" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN npm WARN Conflicting peer dependency: react-dom@16.14.0 npm WARN node_modules/react-dom npm WARN peer react-dom@"^15.5.4 || ^16.0.0" from react-scroll@1.7.16 npm WARN node_modules/mdbreact/node_modules/react-scroll npm WARN react-scroll@"1.7.16" from mdbreact@5.2.0 npm WARN node_modules/mdbreact npm WARN deprecated @material-ui/system@3.0.0-alpha.2: You can now upgrade to @mui/system. See the guide: https://mui.com/guides/migration-v4/ npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1 npm WARN deprecated material-ui-pickers@2.2.4: You can now upgrade to @material-ui/pickers. Documentation for v2 can be found at https://material-ui-pickers-v2.dmtr-kovalenko.now.sh/ npm WARN deprecated core-js@1.2.7: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. npm WARN deprecated @material-ui/core@3.9.3: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5. added 231 packages, and audited 232 packages in 54s 28 packages are looking for funding run `npm fund` for details 7 vulnerabilities (6 low, 1 high) To address issues that do not require attention, run: npm audit fix To address all issues (including breaking changes), run: npm audit fix --force Run `npm audit` for details. Initialized a git repository. Success! Created with-mdbreact-app at D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app Inside that directory, you can run several commands: npm run dev Starts the development server. npm run build Builds the app for production. npm start Runs the built app in production mode. We suggest that you begin by typing: cd with-mdbreact-app npm run dev ```

but then I tried to run it and visit the app and unfurtonately ended up with the same error:

npm run dev ``` PS D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs> cd .\with-mdbreact-app\ PS D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app> npm run dev > dev > next dev ready - started server on 0.0.0.0:3000, url: http://localhost:3000 event - compiled client and server successfully in 2.4s (190 modules) wait - compiling / (client and server)... event - compiled client and server successfully in 627 ms (280 modules) 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem. at resolveDispatcher (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\mdbreact\node_modules\react\cjs\react.development.js:1476:13) at Object.useState (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\mdbreact\node_modules\react\cjs\react.development.js:1507:20) at Ze (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\mdbreact\dist\mdbreact.js:1:110690) at renderWithHooks (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5658:16) at renderIndeterminateComponent (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5731:15) at renderElement (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5946:7) at renderNodeDestructiveImpl (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6076:14) at renderNode (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6259:12) at renderChildrenArray (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6211:7) 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://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem. at resolveDispatcher (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\mdbreact\node_modules\react\cjs\react.development.js:1476:13) at Object.useState (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\mdbreact\node_modules\react\cjs\react.development.js:1507:20) at Ze (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\mdbreact\dist\mdbreact.js:1:110690) at renderWithHooks (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5658:16) at renderIndeterminateComponent (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5731:15) at renderElement (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:5946:7) at renderNodeDestructiveImpl (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6076:14) at renderNode (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6259:12) at renderChildrenArray (D:\Users\Win10\Desktop\Visual Studio\Visual Studio Code\Projects\Testings\test-nextjs\with-mdbreact-app\node_modules\react-dom\cjs\react-dom-server.browser.development.js:6211:7) { page: '/' } wait - compiling /_error (client and server)... event - compiled client and server successfully in 66 ms (281 modules) ```