-
Notifications
You must be signed in to change notification settings - Fork 26.1k
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
Instrumentation loads as client component, even in Node runtime #57563
Comments
Still an issue in |
Can confirm this issue exists in v13.5 also |
This comment has been minimized.
This comment has been minimized.
I have this issue as well |
I'm experiencing the same problem on Next.js version 14.0.5-canary.44. |
Should |
### What When users're using nextjs server API that break the build, and error with incorrect client components usage. Instrument should be treated as server components or server-only build target, instead of being treated as client components. ### How We added a new layer `instrument` for instrument hook bundling, and apply it with the rsc server webpack loaders Fixes #57563 Closes NEXT-2181 Closes NEXT-1994
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Link to the code that reproduces this issue
https://github.com/bbangert/nextjs-instrumentation-bug
To Reproduce
instrumentation.ts
file.instrumentation-node
file per Documentationinstrumentation-node
file.Current vs. Expected behavior
Current behavior is that Nextjs errors as
instrumentation.ts
is a client component, and cannot loadserver-only
code.Error:
Expected behavior is that code targeted to run in Node runtime only should be capable of being marked as
server-only
code.Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #96-Ubuntu SMP Wed Sep 20 08:23:49 UTC 2023 Binaries: Node: 18.18.2 npm: 9.8.1 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.0.0 eslint-config-next: 14.0.0 react: 18.2.0 react-dom: 18.2.0 typescript: 5.2.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
No response
NEXT-2181
The text was updated successfully, but these errors were encountered: