When running jaspr through dart .\lib\main.dart or through a built Jaspr executable (made with jaspr build), the _findRootProjectDir (in lib/src/server/server_handler.dart) can enter an infinite loop.
This is because (for reasons) Platform.script.path returns the the path with a leading slash. E.g.:
Description
When running jaspr through
dart .\lib\main.dart
or through a built Jaspr executable (made withjaspr build
), the_findRootProjectDir
(inlib/src/server/server_handler.dart
) can enter an infinite loop.This is because (for reasons)
Platform.script.path
returns the the path with a leading slash. E.g.:This causes 3 issues that combine to create an infinite loop.
dirname('/')
returns "/", sodir.isNotEmpty
always fails (this might be true on Linux as well?)If looks like the proper fix is to use
Platform.script.toFilePath()
Steps To Reproduce
1) Create a jaspr project on windows 2) Run
dart lib/main.dart
-or-
1) Create a jaspr project on windows 2) run
jaspr build
3) Renamebuild/jaspr/app
tobuild/jaspr/app.exe
4) Runapp.exe
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
You can run a Jaspr server on windows.