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

[BUG] RegExp are proxified which breaks them #722

Open
CGNonofr opened this issue Mar 6, 2023 · 0 comments · May be fixed by #723
Open

[BUG] RegExp are proxified which breaks them #722

CGNonofr opened this issue Mar 6, 2023 · 0 comments · May be fixed by #723

Comments

@CGNonofr
Copy link

CGNonofr commented Mar 6, 2023

Describe the bug
Due to this commit, regexes are now broken.

If your configuration contains a regex, you'll get a proxified regex which seems to be ok but it will crash as soon as you try to use it with an error: TypeError: RegExp.prototype.source getter called on non-RegExp object

Expected behavior
You can put regexes in your config files (in cjs or ts format) and use it in your code

Please tell us about your environment:

  • node-config version: 3.3.9
  • node-version: 16.19.1

Other information

A workaround is to enable ALLOW_CONFIG_MUTATIONS but it's not an acceptable solution

@CGNonofr CGNonofr linked a pull request Mar 6, 2023 that will close this issue
@CGNonofr CGNonofr changed the title [BUG] RegExp are proxified which breaks it [BUG] RegExp are proxified which breaks them Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant