Deploy failed on Functions stage with RangeError: Maximum call stack size exceeded

Hi, i was refactoring my project to SSR platform with stack of: React+vite+vite-plugin-ssr, but got an issue with netlify build on my develop branch during open PR
I had making by this example to check if everything will work on deployed site
But something went wrong during the build


tried to find something on forum and in other sources, but didn’t find something.

Hope someone might help me with it :smiley:

  • DNS issues - no

Hi @MatHook , I’m wondering if you can try adding the following environment variable in the Netlify UI on your site’s deploy settings under “Environment”:

NETLIFY_VERBOSE=1

This will output more information to the deploy log during your build, and this additional info should help with further troubleshooting.

looks like because it was refactored to ssr and old publish directory is just dist, do i just need to change it to dist/client?

Hiya @MatHook ,

As far as I can tell, the actual cause for failure in your latest build is that it did not run at all in the latest deploy, so no files were created and the directory where you configured us to look for them was not created either and that’s what that error is reporting. You can see why here in your build logs:

If you get your build running again, then wherever it outputs files like /index.html (the root page for your site if you have one) is probably the appropriate publish directory. Looking at the last build that did run (Netlify App) it seems like client/dist is probably still correct.

As to what causes the RangeError, in the past we’ve pointed people to resources like these to debug (since it is almost certainly something about your code, likely a recursive call of some sort). Not sure they’ll help here, but the articles linked from here would be a good first-pass thing for you to start your debugging with, if you want to resume building here: