Gatsby Error: Failed to Server Render (SSR) on Layer5

After cloning the layer5 website repository on my local machine,
I did make setup and make site but getting the following error:
Note: I am using WSL and Gatsby CLI version: 5.12.1 & Gatsby version: 4.25.7 along with latest node 18 version

Tried the solution mentioned here but not working:

Logs:

warn The path "/" errored during SSR.
Edit its component node_modules/@gatsbyjs/reach-router/es/lib/utils.js:249:1 to resolve the error.

 ERROR #11616

There was an error while trying to create the client-only shell for displaying SSR errors:
 React.Children.only expected to receive a single React element child.

File: node_modules/@gatsbyjs/reach-router/es/lib/utils.js:249:1

I faced this issue earlier. Therefore I shifted bash terminal on vs code. Make sure to install all dependencies on windows. I hope this finds you well :crossed_fingers:.

1 Like

Thank you @Vaibhav.Maurya for the response. I have tried using the bash terminal in the VsCode itself. It solves the problem of ‘/’ route but for ‘/blog’ route it is giving the same issue (screenshot below).

Regarding

Make sure to install all dependencies on windows.

Should I perform the npm install outside wsl as well (i.e on the windows machine)?

Yes, you have to npm install outside the wsl.

Thanks for the help @Vaibhav.Maurya, I am running the server without WSL and it is working fine for now.

1 Like