Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Compiled regex exceeds size limit of 10485760 bytes." #775

Open
bradzacher opened this issue Nov 6, 2023 · 1 comment
Open

"Compiled regex exceeds size limit of 10485760 bytes." #775

bradzacher opened this issue Nov 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@bradzacher
Copy link

Version: 0.41.0

One of our engineers tried to do a format of a folder with a relative glob today:
dprint fmt -- ./folder/path/**/*.ts

This glob was expanded by zsh to a set of ~2600 paths.
Of these paths around 2200 of them were ignored files (they were within node_modules :sigh:).
The dprint CLI quickly dies out with the following error:

Compiled regex exceeds size limit of 10485760 bytes.

As this is an opaque error message, the bug was reported to us to investigate.

I'm assuming that the error occurs because the glob is expanded to a set of relative paths. We haven't seen this issue before on our CI pipelines (which regularly pass well over 2.6k paths) - but I assume that we don't see it because they're always absolute paths?

As a workaround we advised the engineer to always quote their globs to prevent expansion.

I'm not sure if you have an insight into where this error message might originate - but it would be great if we could catch it to provide a clearer message.

@dsherret dsherret added the bug Something isn't working label Nov 6, 2023
@dsherret
Copy link
Member

dsherret commented Nov 6, 2023

There are some optimizations that could be made here, but yeah that's good advice to quote it beforehand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants