-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Custom error object appears as [Object object] #31670
Comments
Changing the line to stringify object errors resolves the issue, but I'm not sure it's the best approach.
|
I believe changing next.js/packages/next/server/next-server.ts Line 2298 in cf64e91
const err = isError(error) ? error : error ? new Error(JSON.stringify(error)) : null should be enough. Since this code appears a lot in the codebase it would probably be better to replace all its instances I'd guess.
Do you need help opening a PR @mozeryansky ? As a sidenote, perhaps |
@awareness481 Great suggestion. I'll make a PR now. |
Facing same issue on iOS browsers(Safari, chrome, firefox) |
hey how to run your application. I can solve your issue. |
I already solved it in PR #31866 |
Except I can't get any maintainer to respond. I tried commenting in the PR a few times, and I've messaged a couple of them in Twitter directly. No response. |
Ok man. No issues
…On Tue, 11 Jan, 2022, 12:27 am Michael Ozeryansky, ***@***.***> wrote:
Except I can't get any maintainer to respond. I tried commenting in the PR
a few times, and I've messaged a couple of the in Twitter directly. No
response.
—
Reply to this email directly, view it on GitHub
<#31670 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKGMGYUSUAYURGXJWT2MZY3UVMTYVANCNFSM5IQBKZQQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you commented.Message ID: <vercel/next.
***@***.***>
|
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
12.0.4
What version of Node.js are you using?
14.18.1
What browser are you using?
Firefox
What operating system are you using?
macOS
How are you deploying your application?
next
Describe the Bug
I'm using supabase with nextjs, a postgres error thrown is reported as "[object Object]" instead of the contents.
The issue originates in
next-server.js
andnext-dev-server.js
from:const err = (0, _isError).default(error) ? error : error ? new Error(error + '') : null;
Expected Behavior
To treat print the object as is instead of converting to a string.
To Reproduce
npx create-next-app -e https://github.com/vercel/nextjs-subscription-payments nextjs-subscription-payments
NEXT_PUBLIC_SUPABASE_URL
andNEXT_PUBLIC_SUPABASE_ANON_KEY
in the .env.localnpm run dev
The error is reproduced assuming the database isn't setup and causes the postgres error.
The text was updated successfully, but these errors were encountered: