Open AaronVr opened 1 year ago
When I change to "next": "13.4.10"
, everything works as intended.
It works here https://stackblitz.com/github/AaronVr/nextjs-client-component-bug?file=README.md
Recently we saw this error with Node 16.13, and earlier. Could you maybe try a different Node version? Say 18?
Using a newer node version (20) actually did fix it! Thanks so much!
So Node 17 is also not good? Could you please confirm if was Node 17 you had before?
Yes, I had Node 17 before. (More precisely: v17.1.0)
Ugh, I was expecting this to be only on Node 16.13 and lower. Alright then, it is best to use the Node LTS anyway.
If you are good to go, please do close the issue :)
Wonder if node 17.1 is too early that nodejs have some bug fixes after it as the newer version of node v17 is v17.9.1
, may consider just upgrading to newer nodejs too see if it fixes for you?
Everything works when I upgrade Node to newer version (20). The old Node version was 16.13
Using a newer node version (20) actually did fix it! Thanks so much!
Same error with Node v18.17.1
Error was fixed for me on Node v18.17.1 -- also working on our vercel deployment which is Node v10.x
Bug persisted for me as well. Downgraded next to 13.4.10 and client components are now working 🥲
I have the same problem with node v20.16.0
When starting server, on first page render, client components are not functionnal. Using NextJS v14.2.5
Any workaround ?
I have the same problem with node v20.16.0
When starting server, on first page render, client components are not functionnal. Using NextJS v14.2.5
Any workaround ?
Might be related to this https://github.com/wallabyjs/console-ninja/issues/332
I have deployed in vercel. But the problem still exists! I am React Query and react query dev tools. Sometime react query doesn't show any query! It shows and the site becomes interactive again when I reload the page. It seems like the page is server component and "use client" doesn't have any effect?
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
No response
Link to the code that reproduces this issue or a replay of the bug
https://github.com/AaronVr/nextjs-client-component-bug
To Reproduce
app/counter.tsx
app/counter.tsx
:import { useEffect, useState } from 'react'
export default function Counter() { const [count, setCount] = useState(0)
useEffect(() => { console.log('In use effect.') }, [])
return (
You clicked {count} times
) }
import Counter from "./counter";
/* Add your relevant code here for the issue to reproduce / export default function Home() { return
}
'use client'
import { useEffect, useState } from 'react'
export default function Counter() { const [count, setCount] = useState(0)
useEffect(() => { console.log('In use effect.') }, [])
return (
You clicked {count} times
) }