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

Remove supress warnings #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Remove supress warnings #63

wants to merge 1 commit into from

Conversation

dogagenc
Copy link

@dogagenc dogagenc commented Mar 4, 2023

The code line console.warn = ... is causing an error in Firefox that interrupts the program's execution. In addition, I believe that it is not advisable to silence warnings from the framework or UI library when they are used as a sub-package.

@pablo-abc
Copy link
Owner

Hey! Is there a way to silence this warnings now? This was added due to many complaints about the "unused prop" warnings. The console can be flooded by these.

@dogagenc
Copy link
Author

Hey! Is there a way to silence this warnings now? This was added due to many complaints about the "unused prop" warnings. The console can be flooded by these.

@pablo-abc It is not wise to clear Svelte warnings. What if you miss a warning that helps you to fix a bug? I recommend that you keep it as is. You can always enable/disable warnings in browser console.

@aryzing
Copy link

aryzing commented Oct 3, 2023

Second the change. Silently modifying globals is a sure way to cause a lot of pain. If it helps, all modern consoles have filters that can be used to tune out unwanted logs.

@dogagenc
Copy link
Author

dogagenc commented Oct 3, 2023

@aryzing Maintainer seems unresponsive. So, i have created and published fixed version to npm. See my comment here:

#64 (comment)

@aryzing
Copy link

aryzing commented Oct 3, 2023

Thank you @dogagenc. I'll take a look at your fork.

Fyi @pablo-abc, if you've got too much on your plate now, you may want to consider adding contributors to this repo. Seems that if this repo doesn't receive more attention, more forks may start to take off. Given this repo's popularity, seems we would best served by capturing further improvements here.

@myieye
Copy link

myieye commented Nov 27, 2023

@pablo-abc suppressWarnings() appears to be killing our server, because you only undo the override in onMount i.e. on the client, so the server call-stack for console.warn just grows and grows 💥.

2023-11-27T11:20:41.244562118Z server-error-hook RangeError: Maximum call stack size exceeded
    at console.warn (file:///app/server/chunks/FormError-9675a090.js:3981:18)
    at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
2023-11-27T11:20:41.244590339Z     at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
    at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
    at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
    at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
    at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
2023-11-27T11:20:41.244610389Z     at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
    at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5)
2023-11-27T11:20:41.244616359Z     at console.warn (file:///app/server/chunks/FormError-9675a090.js:3986:5) {

@myieye
Copy link

myieye commented Nov 28, 2023

FYI I opened a PR which is a bit less drastic than just suppressing all the warnings (which are truly annoying).
I also noticed that even SvelteKit supresses warnings like this, so it seems fairly reasonable if done well.

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 this pull request may close these issues.

4 participants