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

env variable DEBUG is not parsed correctly #989

Open
zymon opened this issue Jan 16, 2025 · 0 comments
Open

env variable DEBUG is not parsed correctly #989

zymon opened this issue Jan 16, 2025 · 0 comments

Comments

@zymon
Copy link

zymon commented Jan 16, 2025

If the DEBUG env variable contains multiple items separated with spaces, then only the first one is used.

For example:
export DEBUG="APP_X APP_Y APP_Z"

Then, only the APP_X is enabled for debugging. Other apps are ignored. This is due to the way the string is parsed:

In debug\src\common.js, line 169:

const split = (typeof namespaces === 'string' ? namespaces : '') .trim() .replace(' ', ',') .split(',') .filter(Boolean);

replace('', ',') changes only the first occurrence of space

So, to fix it you can use regexp:

const split = (typeof namespaces === 'string' ? namespaces : '') .trim() .replace(/ /g, ',') .split(',') .filter(Boolean);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant