-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Closed as not planned
Labels
Module ResolutionModule resolution (CJS / ESM, module resolving).Module resolution (CJS / ESM, module resolving).bugIssue was opened via the bug report template.Issue was opened via the bug report template.staleThe issue has not seen recent activity.The issue has not seen recent activity.
Description
Link to the code that reproduces this issue
https://github.com/flo-dao/repro-fast-refresh
To Reproduce
- Start the app in dev
- Make a change in
index.tsx
- You get a full page reload, with a message in the console indicating that fast refresh didn't work
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
:
const nodejsRandomBytes = await (async () => {
try {
return (await import('crypto')).randomBytes;
}
catch {
return nodejsMathRandomBytes;
}
})();
If I turn this into a promise without async await, the fast refresh works as expected.
allanchau and lourd
Metadata
Metadata
Assignees
Labels
Module ResolutionModule resolution (CJS / ESM, module resolving).Module resolution (CJS / ESM, module resolving).bugIssue was opened via the bug report template.Issue was opened via the bug report template.staleThe issue has not seen recent activity.The issue has not seen recent activity.