- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 4.7k
 
          fix: don't define error.message if it's not configurable
          #16149
        
          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
Conversation
          🦋 Changeset detectedLatest commit: 53afa99 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
 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  | 
    
          
 | 
    
| console.error( | ||
| "The following it's not a separate error: we usually modify the error message to show you this information but `message` was non configurable so we print them in a separate log.\n" + | ||
| error.message + | ||
| `\n${component_stack}\n` | ||
| ); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ... a lot 😄 I would trim this down to just this, or just not log anything at all. I don't know how many people will have worse stacks as a result, but I doubt it's many
| console.error( | |
| "The following it's not a separate error: we usually modify the error message to show you this information but `message` was non configurable so we print them in a separate log.\n" + | |
| error.message + | |
| `\n${component_stack}\n` | |
| ); | |
| console.error( | |
| "[adjusted stack] " + | |
| error.message + | |
| `\n${component_stack}\n` | |
| ); | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I feared it would've been a lot but also wanted to make it clear it was not a separate error
| 
           this seems like a real edge case. i would just skip the   | 
    
          
 Yeah it's also fine...let me revert it  | 
    
Closes #16146
For the moment I changed this to not include the rest of the logs at all but i wonder if we
should at leastconsole.errorthem even if we don't change the original message (or if it could make sense to throw a different error, but that could be tricky).Ok I've also added a
console.errorwith the updated info, with an initial line that tells the user that it's not a second error, just a secondconsole.errorWDYT?
Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint