-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module not found: Can't resolve '#async_hooks'. Getting error with modules using sub-path imports #58052
Comments
What are the values of |
Hello, In my "module": "esnext",
"moduleResolution": "node", I am using |
Does changing |
I tried, but changing |
The crutch is |
I have the same error with App Router structure. Any update ? I've check closed issue on p-limit repo: sindresorhus/p-limit#72 The problem is solved if i use |
For reference I solved this from failing in jest by having the following jest config: (this is inside my package.json)
|
Just noting that this is still an issue. sindresorhus/p-limit#72 |
The error generated is caused by specific (incorrect) behaviour in https://github.com/webpack/enhanced-resolve/releases/tag/v5.17.1 This is also affecting our builds for internal packages |
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/sharp-spence-fyy83f
To Reproduce
The codesandbox provided displays the error message when running the application.
Explanation:
In one of my projects I am using p-limit. The last update of this dependency, version 5.0.0 takes advantage of sub-path imports, which apparently NextJS 14 does not handle very well, and reports the error above when compiling the page.
Current vs. Expected behavior
Expected behaviour:
No error should be raised with the module p-limit used in a server component.
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Binaries: Node: 20.8.1 npm: 10.1.0 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.0.1 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
I did not actually try with canary on codesandbox because when canary, the appDir was said to be experimental. So the example given is with version 14.0.1 of NextJS.
The text was updated successfully, but these errors were encountered: