If a widget throws an exception during rendering (for example during preloadState) the exception is not bubbled up to shelf, and thus no response is sent to the browser, which looks in Firefox to just be an infinite load.
Steps To Reproduce
Create a Component that throws an exception during preloadState.
Load the page containing the component.
Doctor Output
[✓] Jaspr CLI (Version 0.9.2)
• Dart Version 3.1.3 (stable) (Tue Sep 26 14:25:13 2023 +0000) on "windows_x64" at C:\Users\Jeff Ward\Projects\flutter\bin\cache\dart-sdk\bin\dart.exe
• Running on windows "Windows 10 Home Single Language" 10.0 (Build 19045) - Locale en-US
• Analytics: Enabled
This is because the Isolate.spawn does not automatically propagate error back to the calling isolate. I have a fix locally, and I'll work on getting a PR up in the next few days if you're open to it.
Description
If a widget throws an exception during rendering (for example during
preloadState
) the exception is not bubbled up to shelf, and thus no response is sent to the browser, which looks in Firefox to just be an infinite load.Steps To Reproduce
preloadState
.Doctor Output
[✓] Jaspr CLI (Version 0.9.2) • Dart Version 3.1.3 (stable) (Tue Sep 26 14:25:13 2023 +0000) on "windows_x64" at C:\Users\Jeff Ward\Projects\flutter\bin\cache\dart-sdk\bin\dart.exe • Running on windows "Windows 10 Home Single Language" 10.0 (Build 19045) - Locale en-US • Analytics: Enabled
[✓] Current Project • Dependencies on core packages: • jaspr: ^0.9.2 • jaspr_builder: ^0.9.2 (dev) • jaspr_router: ^0.3.0 • Uses server-side rendering: true • Uses experimental compilers: false • Uses flutter embedding: false
Expected Behavior
Server should properly return a 500 error.
Additional Context
This is because the
Isolate.spawn
does not automatically propagate error back to the calling isolate. I have a fix locally, and I'll work on getting a PR up in the next few days if you're open to it.