Turbopack HMR does not work when using ternaries and JSX together. #69360
Labels
bug
Issue was opened via the bug report template.
Performance
Anything with regards to Next.js performance.
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
https://github.com/heyitsarpit/turbo-hmr-bug
To Reproduce
pnpm dev
HMR_Works.tsx
HMR_Error.tsx
Current vs. Expected behavior
Expected behaviour: React state should not be reset after editing either
HMR_Works.tsx
orHMR_Error.tsx
Current behaviour: Editing
HMR_Error.tsx
causes a full page reload and the react state resets.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 20.17.0 npm: 10.8.2 Yarn: 1.22.19 pnpm: 9.1.3 Relevant Packages: next: 14.2.6 // Latest available version is detected (14.2.6). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.4 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Performance, Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I did not observe this behaviour with webpack. Also HMR keeps failing even if I comment out the ternary + JSX code.
The text was updated successfully, but these errors were encountered: