Master NextJS Error Handling in 10 Minutes

Master NextJS Error Handling in 10 Minutes

Josh tried coding

1 год назад

43,430 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@aroojshahid5658
@aroojshahid5658 - 28.11.2023 00:17

can you please talk about prerender error on nextjs 13? i am having this error on my cart folder which consists of components and 1 page.tsx file

Ответить
@bongkotsaelo4239
@bongkotsaelo4239 - 15.11.2023 05:29

Thanks, I'm struggled at ErrorBoundary at first, no idea that nextjs handle it automatically. 😂

Ответить
@andersbraathen1256
@andersbraathen1256 - 30.10.2023 01:01

Thank you, great video! Wouldn`it be easier to just put all the Auth error code on the error.ts page? Use session and show message since every error redirects to error page instead of putting AuthRequiredError on every page? Like: {!session && 'Please log in if you want to continue'}

Ответить
@andrepadez
@andrepadez - 03.10.2023 02:56

Can this also be implemented in a pages router? If not, i would consider migrating to app router just for this

Ответить
@alaeddinemenai5380
@alaeddinemenai5380 - 18.09.2023 07:33

Thank you Josh- Big fan of you-. I went in depth with documentation and I just confused between expected and unexpted exceptions. Based on the documentation, this file is used for unexpected errors during the runtime. LIke network interruption, ... and we use this file to display human friendly errors to the users with the ability to recover the situation ( recovered network ) instead of refresh the page. While we can track the errors using error reporting service like sentry. Correct me if I'm wrong?

Ответить
@galusmarcin87
@galusmarcin87 - 12.09.2023 15:22

i dont know why but nextjs returns 200 status code when error occurs, why not 503?

Ответить
@n8body_dev
@n8body_dev - 04.08.2023 22:52

I don't think that's the right way to use error.js, because the documentation says "An error file defines an error UI boundary for a route segment. It is useful for catching unexpected errors that occur in Server Components and Client Components and displaying a fallback UI." where the word "unexpected" is specially bolded. That explains why we actually can't use custom error classes - the name of the caught error will always be "Error" (as one other guy pointed out in the comments) and we won't be able to get any custom props.

Ответить
@yousuf4you
@yousuf4you - 04.08.2023 11:00

How to remove left-bottom error notation button from nextjs default error?

Ответить
@fiendsgaming7589
@fiendsgaming7589 - 21.07.2023 17:49

How do i send error with status code from api?

Ответить
@solimanfarag2845
@solimanfarag2845 - 20.07.2023 17:38

-1

I used google as an auth provider with nextjs and i deplyed the app but receive There is a problem with the server configuration. Check the server logs for more information. nextjs

Ответить
@LaluIbnuHidayatullah
@LaluIbnuHidayatullah - 15.07.2023 14:42

can you share mote about handle "Error: Hydration failed because the initial UI does not match what was rendered on the server. " ?

Ответить
@psyferinc.3573
@psyferinc.3573 - 12.07.2023 11:46

this was awesome

Ответить
@luizmateusramos
@luizmateusramos - 02.07.2023 00:25

Hey josh , how could yo remove the red box with the warning of error? everytime that i click there it show a part of my code
where the exception was throwed

Ответить
@tabmax22
@tabmax22 - 30.06.2023 16:36

does this work via the catch error when fetching data?

Ответить
@edmilson8890
@edmilson8890 - 26.05.2023 18:42

Thank you my friend very nice content

Ответить
@Rinace
@Rinace - 19.05.2023 17:49

Can I ask what snippets do you use?

Ответить
@techwithimad4672
@techwithimad4672 - 23.04.2023 10:18

Nice!
What about production error messages?
They are often hidden to ensure that no sensitive data is leaked.
How can we deal with this to know exactly which exceptions were thrown?

Ответить
@satyabhangt
@satyabhangt - 22.04.2023 23:58

Dude this makes me so happy! Thank you for caring ❤

Ответить
@aden-rm2wn
@aden-rm2wn - 19.04.2023 14:56

Josh keep tried coding

Ответить
@starmorph
@starmorph - 19.04.2023 05:59

this is sweet thank you. would love to have those error messages in a toast notification... time to experiment

Ответить
@naman_dw
@naman_dw - 06.04.2023 15:28

can i use next 13 app directory with trpc?

Ответить
@abdelkarimelalaoui1538
@abdelkarimelalaoui1538 - 03.04.2023 05:34

thank you so mush bro

Ответить
@nirjoyhasanantor3149
@nirjoyhasanantor3149 - 02.04.2023 20:47

Can you tell us how can we access req object/context/headers in app directory that we accessed before using getServerSideProps in Next.Js

Ответить
@microspace_ufa
@microspace_ufa - 02.04.2023 20:27

Thank you for your content!

Ответить
@nicolasribeirodossantos2760
@nicolasribeirodossantos2760 - 02.04.2023 20:16

Josh, would you mind sharing your snippets extension? I find it very convenient for ts components

Ответить
@motivation2code
@motivation2code - 02.04.2023 19:49

you are amazing Josh. Thank You

Ответить
@lostin8159
@lostin8159 - 02.04.2023 15:11

Thank you

Ответить
@anuj7286
@anuj7286 - 02.04.2023 14:22

Hey josh, what do you prefer new app directory or pages directory for new projects? I was using remix run its is also great

Ответить