The react hooks will not work. If you have changed the setting of distDir.
I use the [with Firebase Hosting and Typescript example] like architecuture and
If I use hooks in SSR , the error of 銆嶩ooks can only be called inside the body of a function component.銆廻appens.
Doesn't sound like a bug in Next.js, rather you're doing something non-standard in your directory structure that maybe loads 2 versions of React? It's generally not needed to set distDir.
@tky5622 I had this exact same issue and was able to fix it by running npm run clean and then npm run dev again. I used the same starter example code as you as well.
@yongla I have the exact same error.
What does the clean script in your package.json ?
Most helpful comment
@tky5622 I had this exact same issue and was able to fix it by running
npm run cleanand thennpm run devagain. I used the same starter example code as you as well.