I am currently upgrading to use Vite in our internal system. I followed the document here https://laravel.com/docs/9.x/vite
It is working fine with npm run dev
But building npm run build, is throwing an error in terminal
> build
> vite build
error during build:
RangeError: Maximum call stack size exceeded
at String.match (<anonymous>)
at _interpolate (/Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4140:28)
at /Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4176:15
at Array.reduce (<anonymous>)
at _interpolate (/Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4142:18)
at /Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4176:15
at Array.reduce (<anonymous>)
at _interpolate (/Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4142:18)
at /Users/rex/Development/connector-dashboard/node_modules/vite/dist/node-cjs/publicUtils.cjs:4176:15
at Array.reduce (<anonymous>)
I checked the code in publicUtils.cjs at _interpolate() function, from what I understand it is for env variables?
Can you help me resolve this please.