Skip to content

prevent double stack trace 'fixes'#5644

Merged
Rich-Harris merged 4 commits intomasterfrom
gh-3371
Jul 21, 2022
Merged

prevent double stack trace 'fixes'#5644
Rich-Harris merged 4 commits intomasterfrom
gh-3371

Conversation

@Rich-Harris
Copy link
Copy Markdown
Member

please god let this be the last one of these. closes #3371

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 20, 2022

🦋 Changeset detected

Latest commit: 1813041

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

if (error) {
const stack = error?.stack;

if (__SVELTEKIT_DEV__ && error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should include the __SVELTEKIT_DEV__. E.g. at my last company we would show you the stacktrace if you were logged in as an employee. We wouldn't show it to customers, but it was helpful for engineers to have access to it

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do have access to it, in handleError. If we wanted to expose it more broadly than that then we can, but that's a much larger conversation than this change

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, but it's harder to get at on a production machine vs having it just show up on the screen. I don't know that we should place restrictions on what people are allowed to do

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure — it's a conversation worth having, but it needs to be had separately. We currently prevent stack traces from appearing in production (at one point we didn't, but we were called out for bad security practices). This PR doesn't change that and I don't think this bugfix should get bogged down in that discussion, so let's figure it out elsewhere

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I didn't realize we were doing that. this looked like new behavior

@Rich-Harris
Copy link
Copy Markdown
Member Author

alright, whatever gremlins were in the system appear to have left us alone. think this is ready

@Rich-Harris Rich-Harris merged commit 68a30cc into master Jul 21, 2022
@Rich-Harris Rich-Harris deleted the gh-3371 branch July 21, 2022 18:16
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.

Line numbers in browser stack trace are off by 2 for .js files

2 participants