Search code examples
javascriptreactjsnext.jsserverside-javascriptserver-side-rendering

SSR does not work when javascript is disabled


Referring to this ticket here: https://github.com/zeit/next.js/issues/4210 I'm currently wondering why when you disable javascript, most of the content using relay modern and NextJS does not work.

My initial guess is that since NextJS is a React library for server-side rendering, if JavaScript is disabled in chrome, then obviously React does not work. However, NextJS is server-side rendering so therefore disabling javascript on the client side should not be a problem? Therefore, why does this problem still occur?


Solution

  • In a modern SSR scenario, as in an isomorphic application, only the first rendering is done by the server, that returns plain html content together with the js's that will be used for the subsequents rendering.

    In case the browser has javascript disabled you should be seeing only the first rendering as a static page, since what the interpreter does is showing a plain html content, but then you shouldn't be able to interact with the page (that would require js to be enabled)