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

Why cache namespaces? #974

Open
OldStarchy opened this issue Oct 10, 2024 · 0 comments
Open

Why cache namespaces? #974

OldStarchy opened this issue Oct 10, 2024 · 0 comments

Comments

@OldStarchy
Copy link

I do not understand why localstorage is used to cache the enabled namespaces. It seems to just cause confusion with unexpected behavior. #901 #536 #871 #534 #337

I had to spend some time to figure out why

if (process.env.VITE_DEBUG_ENABLE)
    debug.enable(process.env.VITE_DEBUG_ENABLE);

didn't work when I removed the env var. I expected each page load to be an isolated environment until I managed to step through the code and see its caching. I tried to disable storage with debug.store = null but that didn't prevent the initial load.

debug.enable(process.env.VITE_DEBUG_ENABLE ?? '');

is where I landed, which admittedly isn't complicated, but its weird that I had to deal with this problem.

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