jaspr icon indicating copy to clipboard operation
jaspr copied to clipboard

Serve command fails with the VS Code extension.

Open 27labs opened this issue 1 month ago • 4 comments

Description

On a new static site, using the Jaspr option to serve the site on VS Code gives "Jaspr Serve exited with code 255. Press any key to close the terminal." and doesn't serve the site.

Steps To Reproduce

  1. Create a new static site project with the VS Code extension GUI.
  2. Hit F5 and select the Jaspr option.
  3. It will delete the "jaspr_options.yaml" file.
  4. See the error in the terminal.

Expected Behavior

It should serve the site on localhost.

Additional Context

"jaspr serve" in the terminal works fine.

Platform: Windows 11

Installed Jaspr and it's VS Code extension in November 2025

27labs avatar Nov 22 '25 21:11 27labs

I cannot reproduce this, and since you didn't post any logs there isn't anything I can do here.

Please provide full error logs andjaspr doctor output, and then reopen.

schultek avatar Nov 27 '25 11:11 schultek

Here's the terminal output:

Running jaspr in static rendering mode. [CLI] Starting web compiler... [BUILDER] Connecting to the build daemon... [BUILDER] Starting daemon... Unhandled exception: Instance of 'MissingPortFile' #0 _existingPort (package:build_daemon/client.dart:24:37) #1 BuildDaemonClient.connect (package:build_daemon/client.dart:180:9) #2 _startBuildDaemon (package:jaspr_cli/src/dev/client_workflow.dart:102:12) #3 ClientWorkflow.start. (package:jaspr_cli/src/dev/client_workflow.dart:44:24) #4 CancelableCompleter.complete. (package:async/src/cancelable_operation.dart:433:16) Jaspr Serve exited with code 255. Press any key to close the terminal.

Here's the jaspr doctor output:

[✓] Jaspr CLI (Version 0.21.7) • Dart Version 3.10.0 (stable) (Thu Nov 6 05:24:55 2025 -0800) on "windows_x64" at dart • Running on windows "Windows 11 Education" 10.0 (Build 26200) - Locale en-US • Analytics: Enabled [✓] Current Project • Dependencies on core packages: • jaspr: ^0.21.7 • jaspr_builder: ^0.21.7 (dev) • jaspr_web_compilers: ^4.3.2+1 (dev) • jaspr_router: ^0.8.0 • Rendering mode: static • Uses jaspr compilers: true • Uses flutter embedding: false

It's still broken on Windows 11.

27labs avatar Nov 27 '25 14:11 27labs

Try running jaspr clean or restarting the computer, there is something wrong with the underlying build_runner process.

schultek avatar Nov 27 '25 15:11 schultek

Ran jaspr clean but it still gives the same error.

Here's the terminal output:

Running jaspr in static rendering mode. [CLI] Starting web compiler... [BUILDER] Connecting to the build daemon... [BUILDER] Starting daemon... Unhandled exception: Instance of 'MissingPortFile' #0 _existingPort (package:build_daemon/client.dart:24:37) #1 BuildDaemonClient.connect (package:build_daemon/client.dart:180:9) #2 _startBuildDaemon (package:jaspr_cli/src/dev/client_workflow.dart:102:12) #3 ClientWorkflow.start. (package:jaspr_cli/src/dev/client_workflow.dart:44:24) #4 CancelableCompleter.complete. (package:async/src/cancelable_operation.dart:433:16) Jaspr Serve exited with code 255. Press any key to close the terminal.

27labs avatar Nov 29 '25 03:11 27labs

I just started using Jaspr and got same issue. I can't even start it with jaspr serve.

$ jaspr doctor
[✓] Jaspr CLI (Version 0.22.0)
  • Dart Version 3.10.4 (stable) (Tue Dec 9 00:01:55 2025 -0800) on "windows_x64" at C:\Users\dhemas\AppData\Local\flutter\bin\cache\dart-sdk\bin\dart.exe
  • Running on windows "Windows 11 Home Single Language" 10.0 (Build 26200) - Locale en-ID
  • Analytics: Enabled

Using VSCode extension:

Running jaspr in server rendering mode.
Using server entry point: lib/main.server.dart
[CLI] Starting web compiler...
[BUILDER] Connecting to the build daemon...
[BUILDER] Starting daemon...
Unhandled exception:
Instance of 'MissingPortFile'
#0      _existingPort (package:build_daemon/client.dart:24:37)
<asynchronous suspension>
#1      BuildDaemonClient.connect (package:build_daemon/client.dart:180:9)
<asynchronous suspension>
#2      _startBuildDaemon (package:jaspr_cli/src/dev/client_workflow.dart:100:12)
<asynchronous suspension>
#3      ClientWorkflow.start.<anonymous closure> (package:jaspr_cli/src/dev/client_workflow.dart:42:24)
<asynchronous suspension>
#4      CancelableCompleter.complete.<anonymous closure> (package:async/src/cancelable_operation.dart:433:16)
<asynchronous suspension>
Jaspr Serve exited with code 255.
Press any key to close the terminal.

Using jaspr serve, it says can't find dart_sdk.js even though it does exists:

$  jaspr serve 
Running jaspr in server rendering mode.
[BUILDER] Starting daemon...
[BUILDER] About to build [web]...
[BUILDER] 0s jaspr_builder:codec_bundle on 75 inputs; $sdk|lib/$lib$
[BUILDER] 0s jaspr_builder:styles_bundle on 75 inputs; $sdk|lib/$lib$
[BUILDER] 0s jaspr_builder:clients_bundle on 75 inputs; $sdk|lib/$lib$
[BUILDER] 0s jaspr_builder:codec_module on 2341 inputs; collection|lib/algorithms.dart
[BUILDER] 0s jaspr_builder:codec_module on 2341 inputs: 1 no-op; collection|lib/collection.dart
[BUILDER] 0s jaspr_builder:styles_module on 2349 inputs; collection|lib/algorithms.dart
[BUILDER] 0s jaspr_builder:client_module on 2352 inputs; collection|lib/algorithms.dart
[BUILDER] 0s jaspr_builder:client_module on 2352 inputs: 1820 no-op; build_runner|lib/src/build_plan/build_filter.dart
[BUILDER] 8s jaspr_builder:styles_module on 2349 inputs: 2223 no-op; spent 7s sdk; jaspr|lib/src/dom/styles/properties/all.dat
[BUILDER] 3s jaspr_builder:client_module on 2352 inputs: 2194 no-op; spent 2s analyzing; jaspr|lib/src/client/client_binding.t
[BUILDER] 7s jaspr_builder:codec_module on 2341 inputs: 2301 no-op; spent 5s analyzing; jaspr_builder|lib/src/codec/codec_bunt
[BUILDER] 7s jaspr_builder:codec_module on 2341 inputs: 2341 no-op; spent 5s analyzing, 1s resolving
[BUILDER] 0s jaspr_builder:codec_bundle on 75 inputs: 75 no-op
[BUILDER] 0s jaspr_builder:sync_mixins_module on 8 inputs; lib/app.dart
[BUILDER] 0s jaspr_builder:sync_mixins_module on 8 inputs: 8 no-op
[BUILDER] 9s jaspr_builder:styles_module on 2349 inputs: 1 output, 2333 no-op; spent 7s sdk, 1s analyzing; lib/app.sync.dart
[BUILDER] 9s jaspr_builder:styles_module on 2349 inputs: 8 skipped, 4 output, 2337 no-op; spent 7s sdk, 2s analyzing
[BUILDER] 0s jaspr_builder:styles_bundle on 75 inputs: 1 output, 74 no-op
[BUILDER] 0s jaspr_builder:imports_module on 16 inputs; lib/app.dart
[BUILDER] 0s jaspr_builder:imports_module on 16 inputs: 8 skipped, 8 no-op
[BUILDER] 0s jaspr_builder:stub on 1 input; lib/$lib$
[BUILDER] 0s jaspr_builder:stub on 1 input: 1 no-op
[BUILDER] 3s jaspr_builder:client_module on 2352 inputs: 11 skipped, 2 output, 2339 no-op; spent 2s analyzing
[BUILDER] 0s jaspr_builder:clients_bundle on 75 inputs: 1 output, 74 no-op
[BUILDER] 0s jaspr_builder:server_options on 1 input; lib/main.server.dart
[BUILDER] 0s jaspr_builder:server_options on 1 input: 1 output
[BUILDER] 0s jaspr_builder:import_output on 16 inputs; lib/app.imports.json
[BUILDER] 0s jaspr_builder:import_output on 16 inputs: 16 skipped
[BUILDER] 0s jaspr_builder:client_options on 1 input; lib/main.client.dart
[BUILDER] 0s jaspr_builder:client_options on 1 input: 1 output
[BUILDER] 0s jaspr_builder:client_entrypoint on 1 input; lib/main.client.dart
[BUILDER] 0s jaspr_builder:client_entrypoint on 1 input: 1 output
[BUILDER] 0s build_web_compilers:entrypoint_marker on 1 input; web/$web$
[BUILDER] 0s build_web_compilers:entrypoint_marker on 1 input: 1 no-op
[BUILDER] 0s build_web_compilers:entrypoint on 1 input; web/main.client.dart
[BUILDER] [ERROR] build_web_compilers:sdk_js (lazy) on build_web_compilers|$package$:
[BUILDER] [ERROR] Invalid argument(s): Prebuilt SDK file "dart_sdk.js" does not exist at "C:\Users\dhemas\AppData\Local\flutt"
[BUILDER] [ERROR] #0      _copyPrebuiltSdk (package:build_web_compilers/src/sdk_js_compile_builder.dart:175:5)
[BUILDER] [ERROR] #1      SdkJsCompileBuilder.build (package:build_web_compilers/src/sdk_js_compile_builder.dart:81:13)       
[BUILDER] [ERROR] #2      runBuilder.buildForInput (package:build_runner/src/build/run_builder.dart:85:21)
[BUILDER] [ERROR] #3      MappedListIterable.elementAt (dart:_internal/iterable.dart:442:31)
[BUILDER] [ERROR] #4      ListIterator.moveNext (dart:_internal/iterable.dart:371:26)
[BUILDER] [ERROR] #5      Future.wait (dart:async/future.dart:544:26)
[BUILDER] [ERROR] #6      runBuilder.<anonymous closure> (package:build_runner/src/build/run_builder.dart:92:18)
[BUILDER] [ERROR] #7      _rootRun (dart:async/zone.dart:1525:13)
[BUILDER] [ERROR] #8      _CustomZone.run (dart:async/zone.dart:1422:19)
[BUILDER] [ERROR] #9      _runZoned (dart:async/zone.dart:2034:6)
[BUILDER] [ERROR] #10     runZonedGuarded (dart:async/zone.dart:2020:12)
[BUILDER] [ERROR] #11     BuildLogLogger.scopeLogAsync (package:build_runner/src/logging/build_log_logger.dart:45:5)
[BUILDER] [ERROR] #12     runBuilder (package:build_runner/src/build/run_builder.dart:91:24)
[BUILDER] [ERROR] #13     Build._buildForPrimaryInput.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:bu)
[BUILDER] [ERROR] #14     _NoOpBuilderActionTracker.trackStage (package:build_runner/src/build/performance_tracker.dart:333:1)
[BUILDER] [ERROR] #15     Build._buildForPrimaryInput.<anonymous closure>.<anonymous closure> (package:build_runner/src/build)
[BUILDER] [ERROR] #16     TimedActivities._runAsync (package:build_runner/src/logging/timed_activities.dart:105:28)
[BUILDER] [ERROR] #17     TimedActivity.runAsync (package:build_runner/src/logging/timed_activities.dart:47:27)
[BUILDER] [ERROR] #18     Build._buildForPrimaryInput.<anonymous closure> (package:build_runner/src/build/build.dart:529:35)  
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #19     Build._buildOutput (package:build_runner/src/build/build.dart:437:7)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #20     SingleStepReaderWriter._isReadableNode (package:build_runner/src/build/single_step_reader_writer.da)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #21     SingleStepReaderWriter._isReadable (package:build_runner/src/build/single_step_reader_writer.dart:1)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #22     SingleStepReaderWriter.canRead (package:build_runner/src/build/single_step_reader_writer.dart:205:2)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #23     _ensureResources (package:build_web_compilers/src/dev_compiler_bootstrap.dart:636:10)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #24     bootstrapDdc (package:build_web_compilers/src/dev_compiler_bootstrap.dart:43:3)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #25     WebEntrypointBuilder.build.<anonymous closure> (package:build_web_compilers/src/web_entrypoint_buil)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #26     Future.wait.<anonymous closure> (dart:async/future.dart:546:21)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #27     WebEntrypointBuilder.build (package:build_web_compilers/src/web_entrypoint_builder.dart:400:5)      
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #28     runBuilder.buildForInput (package:build_runner/src/build/run_builder.dart:85:7)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #29     Future.wait.<anonymous closure> (dart:async/future.dart:546:21)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #30     BuildLogLogger.scopeLogAsync.<anonymous closure> (package:build_runner/src/logging/build_log_logger)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] build_web_compilers:entrypoint on web/main.client.dart:
[BUILDER] [ERROR] Bad state: Unable to locate required sdk resource build_web_compilers|lib/src/dev_compiler/dart_sdk.js      
[BUILDER] [ERROR] #0      _ensureResources (package:build_web_compilers/src/dev_compiler_bootstrap.dart:637:7)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #1      bootstrapDdc (package:build_web_compilers/src/dev_compiler_bootstrap.dart:43:3)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #2      WebEntrypointBuilder.build.<anonymous closure> (package:build_web_compilers/src/web_entrypoint_buil)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #3      Future.wait.<anonymous closure> (dart:async/future.dart:546:21)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #4      WebEntrypointBuilder.build (package:build_web_compilers/src/web_entrypoint_builder.dart:400:5)      
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #5      runBuilder.buildForInput (package:build_runner/src/build/run_builder.dart:85:7)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #6      Future.wait.<anonymous closure> (dart:async/future.dart:546:21)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] [ERROR] #7      BuildLogLogger.scopeLogAsync.<anonymous closure> (package:build_runner/src/logging/build_log_logger)
[BUILDER] [ERROR] <asynchronous suspension>
[BUILDER] 0s build_web_compilers:entrypoint on 1 input: 1 no-op
[BUILDER] Failed to build with build_runner/jit in 22s; wrote 11 outputs.
[CLI] [ERROR] Failed building web assets. There is probably more output above.
[CLI] [ERROR] Could not start dev server due to build errors.
Terminating web compiler...

dhemasnurjaya avatar Dec 19 '25 11:12 dhemasnurjaya

Seems to be a long-standing issue in webdev: https://github.com/dart-lang/webdev/issues/913

schultek avatar Dec 19 '25 12:12 schultek

I run into the exact same issue,

with VS Code I get Unhandled exception: Instance of 'MissingPortFile' #0 _existingPort (package:build_daemon/client.dart:24:37)

with jaspr serve I get [BUILDER] 0s build_web_compilers:entrypoint on 1 input; web/main.client.dart [BUILDER] [ERROR] build_web_compilers:sdk_js (lazy) on build_web_compilers|$package$: [BUILDER] [ERROR] Invalid argument(s): Prebuilt SDK file "dart_sdk.js" does not exist at "C:\flutter\bin\cache\flutter_web_sdk\kernel\amd-canvaskit"

Any known workarounds?

jaspr doctor: [✓] Jaspr CLI (Version 0.22.0) • Dart Version 3.10.4 (stable) (Tue Dec 9 00:01:55 2025 -0800) on "windows_x64" at dart • Running on windows "Windows 11 Pro" 10.0 (Build 26200) - Locale de-DE • Analytics: Enabled [✓] Current Project • Dependencies on core packages: • jaspr: ^0.22.0 • jaspr_builder: ^0.22.0 (dev) • jaspr_router: ^0.8.1 • Rendering mode: server • Flutter mode: plugins

robert-virkus avatar Dec 21 '25 14:12 robert-virkus

Same issue here

Adaendra avatar Dec 21 '25 15:12 Adaendra

I had the same issue, it was my firts time with Jaspr and I did all the posible with ai helps , at last I had to use jaspr cli and not use Flutter options.

anfeMurillo avatar Dec 21 '25 22:12 anfeMurillo