Next.js Discord

Discord Forum

Issues in following dashboard tutorial

Answered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
I am new to next.js, so kindly forgive if this comes under "basic". I am trying to follow [dashboard ap](https://nextjs.org/learn/dashboard-app/getting-started) tutorial to get a sense of next.js, but after setting the project, installing the dependencies from pnpm and running the development server, rather than getting the desired weboutput as mentioned in tutorial, I am getting the following error.
 ⨯ [TypeError: localStorage.getItem is not a function] {
  digest: '431008679'
}
[TypeError: localStorage.getItem is not a function]
 ⨯ [TypeError: localStorage.getItem is not a function] { page: '/' }
[TypeError: localStorage.getItem is not a function]
[TypeError: localStorage.getItem is not a function]
 ⨯ [TypeError: localStorage.getItem is not a function]
 ⨯ [TypeError: localStorage.getItem is not a function]
[TypeError: localStorage.getItem is not a function]
 ⨯ unhandledRejection: [TypeError: localStorage.getItem is not a function]
 ⨯ unhandledRejection:  [TypeError: localStorage.getItem is not a function]
[TypeError: localStorage.getItem is not a function]
[TypeError: localStorage.getItem is not a function]
 ⨯ [TypeError: localStorage.getItem is not a function]
[TypeError: localStorage.getItem is not a function] { page: '/' }
[TypeError: localStorage.getItem is not a function]
 ⨯ unhandledRejection: [TypeError: localStorage.getItem is not a function]
 ⨯ unhandledRejection:  [TypeError: localStorage.getItem is not a function]
 GET / 500 in 1324ms
 GET / 500 in 34ms

Since I haven't even made any changes to the project, I am thinking it to be a dependencies or releated issue. Nonetheless, any help in resolving the issue would be appreciated. I tried looking for similar issues, one said to mock localStorage. Idk what that means.
Answered by alfonsüs ardani
the fix is either you update next to next 16 or downgrade node to node 22
View full answer

4 Replies

@Cuban Crocodile I am new to next.js, so kindly forgive if this comes under "basic". I am trying to follow [dashboard ap](https://nextjs.org/learn/dashboard-app/getting-started) tutorial to get a sense of next.js, but after setting the project, installing the dependencies from pnpm and running the development server, rather than getting the desired weboutput as mentioned in tutorial, I am getting the following error. ⨯ [TypeError: localStorage.getItem is not a function] { digest: '431008679' } [TypeError: localStorage.getItem is not a function] ⨯ [TypeError: localStorage.getItem is not a function] { page: '/' } [TypeError: localStorage.getItem is not a function] [TypeError: localStorage.getItem is not a function] ⨯ [TypeError: localStorage.getItem is not a function] ⨯ [TypeError: localStorage.getItem is not a function] [TypeError: localStorage.getItem is not a function] ⨯ unhandledRejection: [TypeError: localStorage.getItem is not a function] ⨯ unhandledRejection: [TypeError: localStorage.getItem is not a function] [TypeError: localStorage.getItem is not a function] [TypeError: localStorage.getItem is not a function] ⨯ [TypeError: localStorage.getItem is not a function] [TypeError: localStorage.getItem is not a function] { page: '/' } [TypeError: localStorage.getItem is not a function] ⨯ unhandledRejection: [TypeError: localStorage.getItem is not a function] ⨯ unhandledRejection: [TypeError: localStorage.getItem is not a function] GET / 500 in 1324ms GET / 500 in 34ms Since I haven't even made any changes to the project, I am thinking it to be a dependencies or releated issue. Nonetheless, any help in resolving the issue would be appreciated. I tried looking for similar issues, one said to mock `localStorage`. Idk what that means.
Ive seen this issue couple of times now.
the fix is either you update next to next 16 or downgrade node to node 22
Answer
@alfonsüs ardani the fix is either you update next to next 16 or downgrade node to node 22
Cuban CrocodileOP
Thanks 🙌
The version compatibility should be mentioned in tutorial.
Nonetheless, it got resolved.