Open seiry opened 10 months ago
I am getting this error as well. Next.js 14.1.0
and @swc-jotai/react-refresh
.
Development experience with all the full reloads is not great 🤣
I'm getting this error in Next.js 14.1.0
and @swc-jotai/react-refresh
as well. Agreed it seems the plugin is adding lines above the "use client" directive, causing Next.js problems. Also agreed that my knowledge of Rust is not enough to assist in fixing this, just wanted to raise another flag that something is amiss.
I also got the same problem with Next.js 14.1.0
and @swc-jotai/react-refresh
. Is there any temporary solution to this?
I had my atoms in a seperate file and it worked. Just don't add "use client" to the atom file but just the componet file and import the atoms. Worked for me until I started using focusAtom which caused another issue: https://github.com/pmndrs/swc-jotai/issues/24. So currently I forcibly stopped using the plugin.
Also having this issue as well. I had originally added it because I found that jotai-ssr
wouldn't work without it. In the end, jotai-ssr
didn't work for me (nothing was updating properly) and I had to go back to using useHydrateAtoms([], { dangerouslyForceHydrate: true })
in my next.js stuff.
reproduce step
jotai
and@swc-jotai/react-refresh
@swc-jotai/react-refresh
innext.config.js
reproduce repo
https://github.com/seiry/jotai-refresh-use-client/blob/e2f069f9761f35c75d23a9e71f6a13a279275e9a/next.config.js#L6
log
It seems the plugin added some line at the file header.( sorry I'm not a rust master lol