Skip to content
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

Workbench uncaught exceptions in React #1119

Closed
davemfish opened this issue Nov 17, 2022 · 2 comments · Fixed by #1129
Closed

Workbench uncaught exceptions in React #1119

davemfish opened this issue Nov 17, 2022 · 2 comments · Fixed by #1129
Assignees
Labels
bug Something isn't working in progress This issue is actively being worked on workbench For issues relating to the workbench front-end of invest
Milestone

Comments

@davemfish
Copy link
Contributor

A few people have reported the Workbench starting up with a "blank screen":
image

I think this probably indicates an uncaught exception in a react component. The browser hasn't crashed and the main nodejs process seems fine also, looking at the logs.

Jade reports the Workbench was working fine for a while, then crashed one time, and then this started happening every time she starts the workbench, even after re-installing it.

I'm not sure what problem would persist between sessions, though there are a couple things the workbench looks for on the filesystem on startup.

First step is to setup a react ErrorBoundary to catch and log exceptions that we might be missing now. Especially since devtools is disabled in production.

davemfish added a commit to davemfish/invest that referenced this issue Nov 17, 2022
@davemfish davemfish self-assigned this Nov 17, 2022
@davemfish davemfish added bug Something isn't working in progress This issue is actively being worked on workbench For issues relating to the workbench front-end of invest labels Nov 17, 2022
@davemfish davemfish added this to the 3.12.1 milestone Nov 17, 2022
@davemfish
Copy link
Contributor Author

Okay the extra logging after catching the exception yielded this:

[10:49:14.583] [ErrorBoundary] Error: Cannot read properties of undefined (reading 'workspace_dir')
[10:49:14.585] [ErrorBoundary] {
  componentStack: '\n' +
    '    at RecentInvestJobs (file:///C:/Users/Jade%20DELEVAUX/AppData/Local/Programs/InVEST%203.9.2.post4001+g9e14f03cf%20Workbench/resources/app.asar/build/assets/index.1d3a8bde.js:346:5)\n' +
    '    at div\n' +
    '    at 

That's an error from RecentInvestJobs trying to render a malformed InvestJob from the localforage database. We definitely need some better error-handling there! And/or better validation for the structure of those cached jobs.

@davemfish
Copy link
Contributor Author

Deleting C:\Users\your username\AppData\Roaming\invest-workbench\ clears out that database and is generally worth suggesting to users if anything like this comes up in the future.

davemfish added a commit to davemfish/invest that referenced this issue Nov 21, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 2, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
davemfish added a commit to davemfish/invest that referenced this issue Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress This issue is actively being worked on workbench For issues relating to the workbench front-end of invest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant