RangeError: Maximum call stack size exceeded

Hi Thom,

Thanks for those additional details. At a high level, that site is just massive - these lines from your logs are going to give you big problems:

✔ Finished hashing 150928 files
✔ CDN requesting 100634 files
✔ Finished uploading 100634 assets

and

8:43:29 PM: 143052 new files to upload

As you’ve been seeing, deploying >100k files on a site on our service is a challenge. Most of our sites are much smaller and those that aren’t have to be very intentional about how they build and deploy their site. So, let’s talk about what could work and what would be a good sign that you should stop trying to make it work here :slight_smile:

First off, I applied some yet higher timeouts for your site that should hopefully make deploys from our CI environment (deploys built by us and uploaded from our service to our service) work a bit better.
However, you could (should, if you intend to continue NOT to use our form handling service on this site) make another one, by turning off form processing here: Netlify App as that is a big part of what takes a long time in our scanning each newly uploaded file.

To be clear, having a site this large isn’t a problem; uploading that many new files is a problem. Check out this article about how we handle uploading and caching files:

…and from it your takeaway should be "I’ll want to make sure that subsequent builds of my site change as few files as possible - hundreds, not hundreds of thousands should be your steady state target - and that will help you once you get a single successful deploy since we’ll have a copy of all the files in our database.

From your last CI deploy logs I do see that you managed to upload all files:

8:43:29 PM: 0 new functions to upload
9:32:40 PM: Site deploy was successfully initiated
9:32:40 PM: ​
9:32:40 PM: (Deploy site completed in 50m 24.9s)

(here they were uploaded)

9:32:41 PM: Finished processing build request in 1h13m6.393087668s
9:43:46 PM: Starting post processing
9:43:46 PM: Post processing - HTML
10:55:05 PM: Post processing - header rules
10:55:05 PM: Post processing - redirect rules
10:55:05 PM: Post processing done
10:55:06 PM: Site is live :sparkles:

and here they were preserved after upload since the deploy succeeded (despite the error about the build failing, which was in this case a red herring).

However - it seems that the CLI went to upload 100k different files after that, so I suspect your build is not creating identical outputs when rerun, at least for that 100k files.

You could also consider a change to site layout; for instance you could shard your site into multiple sites using a workflow like this: [Support Guide] Can I deploy multiple repositories in a single site? (in your case, one repo, but maybe stitching together several subdirectories? This would allow your deploys to be reasonably sized and not take forever to upload, since we only upload changed files.

So - I think you’ll want to focus on ensuring that your builds don’t change so many files and then our CI should work better; our CLI may not since ever for a site that size, as it doesn’t upload as fast as our CI environment does.