-
Notifications
You must be signed in to change notification settings - Fork 14
Next 15 does not work if there is an instrumentation.ts file #115
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Verify Next.js canary release
- I verified that the issue exists in the latest Next.js canary release
Describe the bug
The server crashes on startup while trying to compile the instrumentation.ts file.
○ Compiling /instrumentation ...
⨯ ./instrumentation.ts
Error: × failed to invoke plugin on 'Some("/project/workspace/instrumentation.ts")'
[Error: An error occurred while loading instrumentation hook: Cannot find module '/project/workspace/.next/server/instrumentation'
Require stack:
- /project/workspace/node_modules/.pnpm/next@15.3.0-canary.24_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/server/dev/next-dev-server.js
- /project/workspace/node_modules/.pnpm/next@15.3.0-canary.24_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/server/next.js
- /project/workspace/node_modules/.pnpm/next@15.3.0-canary.24_react-dom@19.0.0_react@19.0.0/node_modules/next/dist/server/lib/start-server.js] {
code: 'MODULE_NOT_FOUND',
requireStack: [Array]
Expected behavior
The server to startup normally and the superjson plugin to function.
Reproduction link
https://codesandbox.io/p/devbox/festive-marco-874kzf?workspaceId=ws_UDh5PPYTfH5dS4grc4QC5V
Version
0.6.3
Config
{
reactStrictMode: true,
experimental: {
swcPlugins: [["next-superjson-plugin", {}]],
},
}Additional context
If you delete the instrumentation.ts file OR the superjson plugin line from next config, everything works normally.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working