-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
No longer sending real errors to _error.js
on production builds.
#1814
Comments
Answered here: #1800 (comment) |
Okay, a few questions / points:
|
At some point we introduced a split in how we pass errors around in dev versus prod, and instead of passing the original error object we began to modify it in production. We also ran an additional `loadGetInitialProps()`, which caused anything in `_error`'s initial props method to be loaded twice client-side (first with the previous path, then with the new path, but both with the same error). It's unclear to me why this was necessary in the first place, so I've returned to passing the same `error` object to both the dev and prod error views. cc/ @arunoda This resolves vercel#1814 by passing the actual error to the production `_error` page. Resolves vercel#1814
At some point we introduced a split in how we pass errors around in dev versus prod, and instead of passing the original error object we began to modify it in production. We also ran an additional `loadGetInitialProps()`, which caused anything in `_error`'s initial props method to be loaded twice client-side (first with the previous path, then with the new path, but both with the same error). It's unclear to me why this was necessary in the first place, so I've returned to passing the same `error` object to both the dev and prod error views. cc/ @arunoda This resolves vercel#1814 by passing the actual error to the production `_error` page. Resolves vercel#1814
At some point we introduced a split in how we pass errors around in dev versus prod, and instead of passing the original error object we began to modify it in production. We also ran an additional `loadGetInitialProps()`, which caused anything in `_error`'s initial props method to be loaded twice client-side (first with the previous path, then with the new path, but both with the same error). It's unclear to me why this was necessary in the first place, so I've returned to passing the same `error` object to both the dev and prod error views. cc/ @arunoda This resolves vercel#1814 by passing the actual error to the production `_error` page. Resolves vercel#1814
This is causing some serious problems for us, since Googlebot is triggering a mysterious client-side error when trying to render our pages, and we have not way of debugging it. |
Just wanted to bump this up; I'm still relying on a fork to get this functionality in. I'm guessing there isn't a better prescribed way to track errors in production yet since the I'm happy to send in a PR if we can agree on the right way to proceed; a next config option to send along the errors in production, perhaps? |
This was fixed as of |
Awesome @gcpantazis |
(Copying from #1800 since this is a new issue as a result of that cc/ @arunoda)
#1800 introduced a "fake error" object that's sent to the _error view on production. This creates a feature divergence on dev vs. production, and removed the possibility for tracking errors in
getInitialProps
.My use case is that I want to send that error message to our logs, and the _error.js page is the best single place I see to capture errors that break next on both the client and server. i.e.:
If we're not consistently sending the error object to the error page, do we have a better way to grab and track them?
The text was updated successfully, but these errors were encountered: