-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
'fs' not found using experimental node runtime #35636
Comments
welp that makes a ton of sense. looks like even if you specify the node runtime, it uses the edge runtime.
|
@selfagency it seems you are trying to use mix features not intended to be mixed. What are you trying to accomplish with the experimental runtime? If it is Streaming, why do you need it? From the documentation:
I interprete this as "part of the server is running in edge runtime when specifying 'nodejs' as setting". In Edge Runtime, NodeJS APIs are limited and file system access is prohibited (hence fs will not work) |
Regarding The output of Usage
$ next <command>
Available commands
build, start, export, dev, lint, telemetry, info # <--
Options
--version, -v Version number
--help, -h Displays this message
For more information run a command with the --help flag
$ next build --help (You could try It might explain your issues with runtime switching as a lot has changed since previous versions. 🤔
Could you create an isolated reproduction to be sure you are actually using the |
@MauriceArikoglu I don't want to use the experimental runtime. I want to enable @balazsorban44 What I don't understand is, I don't have Next.js installed globally. And I'm completely deleting the |
@selfagency swc should be enabled by default, if you are using next > 12. If not, you can update next by running You don't need to have next installed globally. Please check your package.json dependencies (or devDependencies) for next and its version. You are probably using a local version (which is always reinstalled on |
You missed the compilation errors part. I upgraded to |
@selfagency I can't do remote diagnosis. Make sure you remove the experimental features and start with a clear config. Post relevant files:
|
My point from #35636 (comment) still stands, we would need a proper reproduction. So far it's not verified what version of Next.js you are using, or how the code actually looks. I noticed from the error message, it looks like you are using So the issue might be unrelated to the runtime config. Maybe you are using these APIs on the client-side. As browsers also lack Could you please link to your code or create a reproduction? Otherwise, we cannot investigate further. |
Crossposting this #36237 (comment) here, since it seems a related issue. Several Node APIs are making the build fail even though none of them are being used on client side. This has happened after updating to react v18 |
Any updates on this? Even with the latest next version Here's my package.json
And my config file
Thanks everyone! |
This issue has been automatically closed because it received no activity for a month and had no reproduction to investigate. If you think this was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
um yeah, that doesn't work.
per your cli's own output, the info command doesn't exist.
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
i am using
"next": "^12.1.2-canary.0"
and"react": "^18.0.0-rc.3"
. my nextjs config explicitly says to usenodejs
and not the edge runtime. however, the build is failing saying that 'fs' can't be found.Expected Behavior
for next to be able to recognize node internals when building for node
To Reproduce
use
and import a package that uses node internals
The text was updated successfully, but these errors were encountered: