Skip to content

Conversation

@wtachau
Copy link
Contributor

@wtachau wtachau commented Nov 25, 2022

We have some code that relies on introspecting the name of console.warn— some metaprogramming to provide dev-only logs. This update to make console.warn an anonymous function means it no longer has a name, which breaks that assumption.

Normally:

console.warn.name
> 'warn'

In SvelteKit dev:

console.warn.name
> ''

@changeset-bot
Copy link

changeset-bot bot commented Nov 25, 2022

🦋 Changeset detected

Latest commit: a7a7281

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dummdidumm
Copy link
Member

What's the reason for this? Stack trace?

@wtachau
Copy link
Contributor Author

wtachau commented Nov 25, 2022

What's the reason for this? Stack trace?

@dummdidumm Sorry for the delay! I created this PR in github.dev and it didn't prompt me for a description. Just updated the PR.

@Rich-Harris Rich-Harris merged commit eebae40 into sveltejs:master Nov 26, 2022
@Rich-Harris
Copy link
Member

thank you!

@wtachau wtachau deleted the patch-1 branch November 26, 2022 19:57
@babhishek21
Copy link

BTW this eats up the call trace because console.warn is not bound to console anymore.
image

Shall I make a PR to fix this? Or does this need an issue for discussion first?

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