pablo-abc / svelte-markdown

Markdown parser to svelte components
MIT License
360 stars 50 forks source link

Globally overrides `console.warn` causing errors if string not passed #71

Open space-nuko opened 1 year ago

space-nuko commented 1 year ago

The global override of console.warn assumes the argument passed is a string but this isn't necessarily the case. It crashes my whole app since I have log statements with different argument types

svelte-markdown.js?v=b129818a:53 Uncaught (in promise) TypeError: message.includes is not a function
    at console.warn (svelte-markdown.js?v=b129818a:53:17)
    at updateAttribute (ComfyProperties.svelte?t=1685400662407:2268:11)
    at Array.change_handler (ComfyProperties.svelte?t=1685400662407:2385:38)
    at Textbox.change_handler (ComfyProperties.svelte?t=1685400662407:1564:36)
    at chunk-PUOMPBAM.js?v=a23c27b8:1014:12
    at Array.forEach (<anonymous>)
    at chunk-PUOMPBAM.js?v=a23c27b8:1013:25
    at handle_change (Textbox.svelte:761:3)
    at $$self.$$.update (Textbox.svelte:987:7)
    at update (chunk-PUOMPBAM.js?v=a23c27b8:1106:8)
khromov commented 1 year ago

Can you show a reduced example that triggers this error?