We use webpack v4 that uses terser-webpack-plugin to generate a SSR build of a react application.
Our application build is generated in two phases:
- Phase 1 – all static files [js, css] are generated
- Phase 2 – server build is generated using reference of static file urls
Phase 1 build is always successful
But during server build, we have started getting this error:
server.js from Terser
RangeError: Invalid string length
My application is huge – ~60 pages with a lot of different components!
Has anyone encountered such error before? What is it and how to resolve it?
Thanks in Advance
I googled some more, but always I would get this is an issue with JSON.stringify that final stringified object is exceeding the string limit. But I am not sure how much that is valid here
Rahul Ranjan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.