Skip to content

Conversation

@chrarnoldus
Copy link
Collaborator

@chrarnoldus chrarnoldus commented Jun 24, 2025

@changeset-bot
Copy link

changeset-bot bot commented Jun 24, 2025

⚠️ No Changeset found

Latest commit: f65fb69

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an error boundary to provide a user-visible error message when a React render error occurs, replacing the previous empty screen behavior. Key changes include:

  • Addition of the KiloCodeErrorBoundary component in TypeScript.
  • Integration of the error boundary into the main App component.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
webview-ui/src/kilocode/KiloCodeErrorBoundary.tsx Introduces a React error boundary component that displays error details.
webview-ui/src/App.tsx Wraps the application component tree with the error boundary.

this.state = {}
}

static getDerivedStateFromError(error: unknown) {
Copy link

Copilot AI Jun 24, 2025

Choose a reason for hiding this comment

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

Consider adding a componentDidCatch lifecycle method to log error details (error and errorInfo) for better debugging, as getDerivedStateFromError only updates the state.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we don't have telemetry currently

Copy link
Contributor

@hassoncs hassoncs left a comment

Choose a reason for hiding this comment

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

Great idea! I'm kinda shocked we didn't have something like this already!

Copy link
Contributor

@markijbema markijbema left a comment

Choose a reason for hiding this comment

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

Do you think this fixes the blank screen of death? That would at least make debugging the root cause a lot easier

@chrarnoldus
Copy link
Collaborator Author

Do you think this fixes the blank screen of death? That would at least make debugging the root cause a lot easier

That's what I hope. Throwing an exception from render code did result in a blank screen.

@chrarnoldus chrarnoldus merged commit 2f6b828 into main Jun 24, 2025
12 checks passed
@chrarnoldus chrarnoldus deleted the christiaan/errorboundary branch June 24, 2025 15:27
@KJ7LNW
Copy link
Contributor

KJ7LNW commented Jun 25, 2025

your test looks really good one it is in F5/debug mode, but did you try building the application and trigger the error?

Correct me if I'm wrong, but your stack trace will not be readable because of production minification and such.

@chrarnoldus
Copy link
Collaborator Author

The stack trace won't be readable, but the message will be I hope.

@chrarnoldus
Copy link
Collaborator Author

chrarnoldus commented Jun 25, 2025

You could try this library: https://www.stacktracejs.com/

but I'm not sure if we ship the required source maps (we probably should though)

@KJ7LNW
Copy link
Contributor

KJ7LNW commented Jun 25, 2025

You could try this library: https://www.stacktracejs.com/

but I'm not sure if we ship the required source maps (we probably should though)

awesome thank you for your help!

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.

5 participants