Problem ocurred because my layout.tsx
was in path folder that is in brackets (client)
and I placed my error.tsx
in the same folder expecting that error page would be shown inside layout.
If I properly understood, because my error.tsx
was in path folder in (client)
, Nextjs. When I moved it one layout higher, it started working. And then i understood that in my situation error.tsx
needs it's own layout not inherit it from (client)
folder's layout, so i left error.tsx
there.