Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"npm run dev" not working #15

Closed
readsreads opened this issue Apr 8, 2021 · 5 comments
Closed

"npm run dev" not working #15

readsreads opened this issue Apr 8, 2021 · 5 comments

Comments

@readsreads
Copy link

I installed nextbook and run

error message

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 (C:\Intellij\projects\nextjs\yoonco-book\node_modules\react\cjs\react.development.js:1476:13)
    at useState (C:\Intellij\projects\nextjs\yoonco-book\node_modules\react\cjs\react.development.js:1507:20)
    at ThemeContextProvider (C:\Intellij\projects\nextjs\yoonco-book.next\server\pages_app.js:1338:61)
    at processChild (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3353:14)
    at resolve (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3270:5)
    at ReactDOMServerRenderer.render (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3753:22)
    at ReactDOMServerRenderer.read (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:3690:29)
    at renderToString (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\react-dom\cjs\react-dom-server.node.development.js:4298:27)
    at Object.renderPage (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\render.js:54:851)
    at Function.getInitialProps (C:\Intellij\projects\nextjs\yoonco-book.next\server\pages_document.js:841:19)
    at loadGetInitialProps (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\lib\utils.js:5:101)
    at renderToHTML (C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\render.js:54:1142)
    at runMicrotasks ()
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\next-server.js:109:97
    at async C:\IntelliJ\projects\nextjs\yoonco-book\node_modules\next\dist\next-server\server\next-server.js:102:142
    warn - C:/IntelliJ/projects/nextjs/yoonco-book/node_modules/@babel/runtime/helpers/arrayLikeToArray.js
    There are multiple modules with names that only differ in casing.
    This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
    Use equal casing. Compare these module identifiers:
  • C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayLikeToArray.js
    Used by 2 module(s), i. e.
    C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\unsupportedIterableToArray.js
  • C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayLikeToArray.js
    Used by 2 module(s), i. e.
    C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayWithoutHoles.js

C:/IntelliJ/projects/nextjs/yoonco-book/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:

  • C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayWithoutHoles.js
    Used by 1 module(s), i. e.
    C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\toConsumableArray.js
  • C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\arrayWithoutHoles.js
    Used by 1 module(s), i. e.
    C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\toConsumableArray.js

C:/IntelliJ/projects/nextjs/yoonco-book/node_modules/@babel/runtime/helpers/assertThisInitialized.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:

  • C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\assertThisInitialized.js
    Used by 2 module(s), i. e.
    C:\IntelliJ\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\possibleConstructorReturn.js
  • C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\assertThisInitialized.js
    Used by 1 module(s), i. e.
    C:\Intellij\projects\nextjs\yoonco-book\node_modules@babel\runtime\helpers\possibleConstructorReturn.js
@amiroff
Copy link
Owner

amiroff commented Apr 8, 2021

Hello @yoonco !

You've got the repo address wrong. You do not have to clone any repo to bootstrap your project. Here is the correct command"

npx create-next-app my-awesome-book -e https://github.com/amiroff/NextBook/tree/master/template
cd my-awesome-book
npm run dev

Closing this as not relevant.

@amiroff amiroff closed this as completed Apr 8, 2021
@readsreads
Copy link
Author

readsreads commented Apr 8, 2021

I just mistyped the repo address and the error is the same.

image

@amiroff
Copy link
Owner

amiroff commented Apr 8, 2021

OK, build runs just fine for me. Let's tackle this one. Could you make sure to check the following:

@amiroff amiroff reopened this Apr 8, 2021
@readsreads
Copy link
Author

readsreads commented Apr 8, 2021

It works well on other pc. There seems to be something wrong with the same error only on the pc I am using now.
Thank you for your help.

@amiroff
Copy link
Owner

amiroff commented Apr 8, 2021

Glad you sorted that out. 🚀

@amiroff amiroff closed this as completed Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants