Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/typeerror-the-payload-argument-must-be-of-type-object-received-null-when-usi-pzgs64
To Reproduce
- Create the following file:
/app/opengraph-image.tsx
import { ImageResponse } from "next/og";
export default async function Image() {
return new ImageResponse(<div>{`aaa`} 🎉</div>, {
width: 1200,
height: 630,
});
}
- Start the Next.js development server
- Access http://localhost:3000/opengraph-image in a browser.
- It is worth to mention that when
🎉 is removed, it works without an error.
Current vs. Expected behavior
Current
⨯ [Error: TypeError: The "payload" argument must be of type object. Received null
at cloneSourceMapV3 (node:internal/source_map/source_map:365:3)
at new SourceMap (node:internal/source_map/source_map:145:21)
at findSourceMap (node:internal/source_map/source_map_cache:339:17)
at getSourcemappedFrameIfPossible (/app/node_modules/next/dist/server/patch-error-inspect.js:163:90)
at parseAndSourceMap (/app/node_modules/next/dist/server/patch-error-inspect.js:265:39)
at sourceMapError (/app/node_modules/next/dist/server/patch-error-inspect.js:288:22)
...
...
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
] {
code: 'ERR_INTERNAL_ASSERTION',
page: '/opengraph-image'
}
Expected
The page shows aaa 🎉 as an image.
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025
Available memory (MB): 31902
Available CPU cores: 8
Binaries:
Node: 20.17.0
npm: 10.8.2
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 15.1.7 // Latest available version is detected (15.1.7).
eslint-config-next: N/A
react: 19.0.0
react-dom: 19.0.0
typescript: 5.7.3
Next.js Config:
output: standalone
Which area(s) are affected? (Select all that apply)
Metadata, Dynamic Routes
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/typeerror-the-payload-argument-must-be-of-type-object-received-null-when-usi-pzgs64
To Reproduce
/app/opengraph-image.tsx🎉is removed, it works without an error.Current vs. Expected behavior
Current
⨯ [Error: TypeError: The "payload" argument must be of type object. Received null
at cloneSourceMapV3 (node:internal/source_map/source_map:365:3)
at new SourceMap (node:internal/source_map/source_map:145:21)
at findSourceMap (node:internal/source_map/source_map_cache:339:17)
at getSourcemappedFrameIfPossible (/app/node_modules/next/dist/server/patch-error-inspect.js:163:90)
at parseAndSourceMap (/app/node_modules/next/dist/server/patch-error-inspect.js:265:39)
at sourceMapError (/app/node_modules/next/dist/server/patch-error-inspect.js:288:22)
...
...
This is caused by either a bug in Node.js or incorrect usage of Node.js internals.
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
] {
code: 'ERR_INTERNAL_ASSERTION',
page: '/opengraph-image'
}
Expected
The page shows
aaa 🎉as an image.Provide environment information
Operating System: Platform: linux Arch: x64 Version: #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 Available memory (MB): 31902 Available CPU cores: 8 Binaries: Node: 20.17.0 npm: 10.8.2 Yarn: 1.22.22 pnpm: N/A Relevant Packages: next: 15.1.7 // Latest available version is detected (15.1.7). eslint-config-next: N/A react: 19.0.0 react-dom: 19.0.0 typescript: 5.7.3 Next.js Config: output: standaloneWhich area(s) are affected? (Select all that apply)
Metadata, Dynamic Routes
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response