schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs, SSR and SSG.
https://jasprpad.schultek.de
MIT License
1.07k stars 65 forks source link

bug: error when serving the server template #135

Closed fusion44 closed 7 months ago

fusion44 commented 9 months ago

Description

Using the server template to create a project results in a broken project.

Steps To Reproduce

  1. create a project jaspr create -t server test
  2. exec cd test
  3. exec jaspr serve -v

output

[CLI] Starting jaspr in development mode...
[BUILDER] Connecting to the build daemon...
[BUILDER] Generating build script...
[BUILDER] Generating build script completed, took 452ms
[BUILDER] Precompiling build script......
[BUILDER] Precompiling build script... completed, took 11.2s
[BUILDER] Starting daemon...
[BUILDER] Initializing inputs
[BUILDER] Building new asset graph...
[BUILDER] Building new asset graph completed, took 1.2s
[BUILDER] Checking for unexpected pre-existing outputs....
[BUILDER] Checking for unexpected pre-existing outputs. completed, took 1ms
[BUILDER] Initializing inputs
[BUILDER] Building new asset graph...
[BUILDER] Building new asset graph completed, took 1.2s
[BUILDER] Checking for unexpected pre-existing outputs....
[BUILDER] Checking for unexpected pre-existing outputs. completed, took 1ms
[BUILDER] Setting up file watchers...
[BUILDER] Setting up file watchers completed, took 3ms
Instance of 'MissingPortFile'

Whether Jaspr web compilers are enabled doesn't matter.

Doctor Output

[✓] Jaspr CLI (Version 0.9.2) • Dart Version 3.1.3 (stable) (Tue Sep 26 14:25:13 2023 +0000) on "linux_x64" at ~/dev/flutter/bin/cache/dart-sdk/bin/dart • Running on linux Linux 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 - Locale de_DE.UTF-8 • Analytics: Disabled

[✓] Current Project • Dependencies on core packages: • jaspr: ^0.9.2 • Uses server-side rendering: true • Uses experimental compilers: false • Uses flutter embedding: false

Seems like the build runner daemon is tripping over something. The exception is thrown in the build daemon client

Here are some other references I've found:

schultek commented 7 months ago

I can better catch this for sure. And I have also experienced this before. However I don't know where this error exactly comes from (some incorrect state the build runner is in but I don't know specifics) so I won't be able to properly fix it.

schultek commented 7 months ago

Figured out this was a breaking change in build_daemon and webdev packages that slipped in with a minor version.

Its unfortunate that since these package are not meant to be consumed as a package dependency (but only as standalone cli) they don't adhere to normal semantic versioning. I've learned from this and put fixed versions for these dependencies so it can't happen again.

schultek commented 7 months ago

Running jaspr update and then dart pub upgrade should fix this issue.