You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And it all works just fine.
Tried executing this regex manually, it was noticeably faster.
Huge CSS source maps
I modified it to output whole CSS, before comment cleanup, looks like a lot of source maps (for each scss file) were added, each containing 4000000++ characters.
Node js with this big amount of data, when using "lazy ." (.?) inside current regex crashes.
Generated complete CSS file before cleanup and modification with all those symbols contains 140635835 characters
I'm not sure what to do about reproduction example.
I tried generating huge SASS files with huge source map entries, but it didn't seem to care.
Something in our case is causing regex to be even more inefficient for this particular case.
Reproduction
Cannot reproduce it exactly without using company's confidential packages
Steps to reproduce
Import a lot of scss files from node_modules containing source maps.
Generated output will contain those source maps.
For some reason it reproduced only when adding @import url("https://fonts.googleapis.com/css?family=Dancing+Script");
I suspect regex is matching something that make it consume even more steps
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Sounds good to me. Would you like to send a PR to use that regex? It's a bit hard to read so maybe we should have a comment that links to https://stackoverflow.com/a/36328890 too.
Hello @Woyken. We like your proposal/feedback and would appreciate a contribution via a Pull Request by you or another community member. We thank you in advance for your contribution and are looking forward to reviewing it!
Describe the bug
I'm trying to build one of our company's projects using vite

It is crashing with error
[vite:css-post] Maximum call stack size exceeded
Solution
From the error I narrowed it down that error occurs because of this regex:
Found this answer on stack overflow:
https://stackoverflow.com/a/36328890
Turns out we can write more performant regex without "lazy"(?) modifier
I modified it in node modules directly to this:
And it all works just fine.
Tried executing this regex manually, it was noticeably faster.
Huge CSS source maps
I modified it to output whole CSS, before comment cleanup, looks like a lot of source maps (for each scss file) were added, each containing 4000000++ characters.
Node js with this big amount of data, when using "lazy ." (.?) inside current regex crashes.
Generated complete CSS file before cleanup and modification with all those symbols contains 140635835 characters
I'm not sure what to do about reproduction example.
I tried generating huge SASS files with huge source map entries, but it didn't seem to care.
Something in our case is causing regex to be even more inefficient for this particular case.
Reproduction
Cannot reproduce it exactly without using company's confidential packages
Steps to reproduce
Import a lot of scss files from node_modules containing source maps.
Generated output will contain those source maps.
For some reason it reproduced only when adding @import url("https://fonts.googleapis.com/css?family=Dancing+Script");
I suspect regex is matching something that make it consume even more steps
System Info
Used Package Manager
npm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: