Fast refresh is broken by a lib using inline await
#61452
Labels
bug
Issue was opened via the bug report template.
Module Resolution
Module resolution (CJS / ESM, module resolving).
Link to the code that reproduces this issue
/~https://github.com/flo-dao/repro-fast-refresh
To Reproduce
index.tsx
Current vs. Expected behavior
Fast refresh should work
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:54:51 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6030 Binaries: Node: 18.18.2 npm: 9.8.1 Yarn: 1.22.21 pnpm: 8.14.0 Relevant Packages: next: 14.1.0 eslint-config-next: 14.1.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.3.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure, Module resolution (CJS / ESM, module resolving)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I pinpointed the code causing the issue in the
bson
lib, here is the link.The final code looks like this in
bson.mjs
:If I turn this into a promise without async await, the fast refresh works as expected.
The text was updated successfully, but these errors were encountered: