-
Notifications
You must be signed in to change notification settings - Fork 29.5k
Closed as not planned
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.lockedstaleThe issue has not seen recent activity.The issue has not seen recent activity.
Description
Link to the code that reproduces this issue
https://github.com/carlos-dubon/nextjs-error-bug
To Reproduce
// app/page.tsx
async function getData(): Promise<number> {
throw {
message: 'MY CUSTOM ERROR',
name: 'My new error',
cause: 'custom error',
};
return 3;
}
export default async function Home() {
const pageData = await getData();
return (
<div>{pageData}</div>
);
}
Current vs. Expected behavior
Throwing a custom error object appears as [Object object]
in my app/error.ts
file. I get a digest but the error is still [Object object] so it isn't helpful at all. I need this because our apps use a common package for calling our apis, and i can't simply modify it to suit only our web app.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Binaries:
Node: 20.10.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.1.0
eslint-config-next: 14.1.0
react: 18.2.0
react-dom: 18.2.0
typescript: 5.3.3
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
App Router
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local)
Additional context
No response
dfaivre
Metadata
Metadata
Assignees
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.lockedstaleThe issue has not seen recent activity.The issue has not seen recent activity.