RangeError: Maximum Call Stack Size Exceeded when loading many records.
Im running into an issue when loading lots of records at once that have issues reported by the JSON:API validator.
Currently we have a conflict with a local is Deleted and isDeleted on the record, which is flagged by the validator and is printed out, but when fetching a large amount of records RangeError: Maximum Call Stack Size Exceeded is thrown when attempting colorize ? console.log(errorString, ...colors) : console.log(errorString);
While i agree I need to fix the validation issue, I think we need something to make it clear what the issues is and potentially a way to print the validation errors that doesn't error due to max call stack.
ooof, guessing you had > 20k records with the issue?
I think it was around 6-7k but there were quite large models, ideally we shouldn't be loading that many but there are time complications related with that. Even still i think this error can crop up when there are issues with schema from my experience.
Sounds like we'll need to do some chunking to stay below the browser limit then and perhaps a try/catch to recover. TL;DR console.log colorization is done via a parameters list and parameters lists contribute to stack size / frame heap both of which have relatively low limits (on the order of 10s of thousands / small number of MBs). Since each line we print requires a minimum addition of 4 string args of ~90bytes being supplied to the console.log call, that limit can get hit quickly by larger payloads with errors.