I
I
Igor Vasiliev2020-11-15 09:37:47
JavaScript
Igor Vasiliev, 2020-11-15 09:37:47

Why does Next.js get a 500 error and how do I fix it?

Hello.
--
You all know that for SEO there is SSR based on React.JS and JavaScript (TypeScript)
And this ready-made solution is called Next.JS

The documentation for production has this information:
https://nextjs.org/docs/api-reference /next.config....

And that's the essence of the question, the problem is that if "pages"there is another folder with .js files
or a page with GET parameters in the folder, then if you intentionally reload the page, ошибка 500.

And I'm talking about production, in development, such an error can also occur, but more often on the 404 page, with which the build makes the page, which can be seen if you check the compiled "out" folder.
Some pages do not experience these problems, some do. Here I actually also try to understand, what not so with this nesting??? How to configure and make sure that this page is in the project?

Still annoying is the issue of setting with a dynamic change of parameters. The documentation for this is scarce. I have a theory that there are rewrites for this since I see routes and patches there.

What is wrong with this Next.JS or am I doing something wrong? And the headache is a redirect to a 404 page if there is no page.

In a development project, everything is ok with this.
If everything is so sad with this, maybe switch to Vue or Angular :)

PS This is just desperation, since I have not found a working solution.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question