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

Should the console warning stay #9

Closed
MacFJA opened this issue Oct 17, 2021 · 2 comments · Fixed by #10
Closed

Should the console warning stay #9

MacFJA opened this issue Oct 17, 2021 · 2 comments · Fixed by #10

Comments

@MacFJA
Copy link
Owner

MacFJA commented Oct 17, 2021

@boatilus, I see that you fork the lib to remove the warning.

Do you mind to explain the use case that make you want to remove the warning ?

I know that in SvelteKit the warning appear quite often if it's used in the server side rendering
(but persistent store shouldn't be avoid been used in the server side 🤔 )

I'm not against removing it (or to add a flag to disable the console.warn).
Feel free to open a PR with the changes 🙂

@boatilus
Copy link

Hey MacJA. Thanks for this library!

You're spot on -- the sole purpose of removing the warning messages is because it pollutes SvelteKit's output. There may be a technique to just suppress the output in svelte.config, but I figured it may be easier for my purposes to fork it.

It's probably best that the warning stays, but putting it behind a flag may be a good option.

@MacFJA
Copy link
Owner Author

MacFJA commented Oct 28, 2021

@boatilus I push a PR (#10) about that:

  • Warnings are displayed only once (mainly for server side)
  • A detection of production mode have been added (if in production mode, no warnings)
  • A flag (disableWarnings()) have been added to disable console.warn

@MacFJA MacFJA closed this as completed in #10 Nov 1, 2021
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.

2 participants