Why is Next.js error 500 and how do I fix it?

  • 0
    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 production documentation contains the following information:
    https://nextjs.org/docs/api-reference/next.config ....

    And this is the essence of the question, the problem is that if there is another folder in the "pages" folder with .js files
    or a page with GET parameters, then if you intentionally reload the page, error 500 appears.

    And I'm talking about production, in a developer, such an error can also occur, but more often on a 404 page, at which the build makes a page, which can be seen if you check the assembled "out" folder.
    Some pages do not experience these problems, some on the contrary. So I'm actually trying to figure out what's wrong with this nesting ??? How to set up and make sure that this page is in the project?

    The question of setting up with a dynamic change of parameters is also annoying. The documentation with this is scarce. I have a theory that there is rewrites for this as I see there are routes and patches.

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

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

    P.S. This is just despair as I never found a working solution.
    JavaScript Willow Duarte, May 17, 2019

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!