Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

webdev error after upgrading to Dart 3.5.0 #56382

Closed
ailabs-software opened this issue Aug 6, 2024 · 6 comments
Closed

webdev error after upgrading to Dart 3.5.0 #56382

ailabs-software opened this issue Aug 6, 2024 · 6 comments
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. os-osx type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dev-compiler

Comments

@ailabs-software
Copy link

ailabs-software commented Aug 6, 2024

% uname -a
Darwin macbook-pro.lan 23.6.0 Darwin Kernel Version 23.6.0: Fri Jul 5 17:56:41 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T6000 arm64

% dart --version
Dart SDK version: 3.5.0 (stable) (Tue Jul 30 02:17:59 2024 -0700) on "macos_arm64"

% webdev --version
3.5.0

% webdev serve --release entry_points:8080

[SEVERE] Could not find a command named "/opt/homebrew/Cellar/dart/3.5.0/libexec/bin/snapshots/frontend_server.dart.snapshot".
[SEVERE] 
[SEVERE] Usage: dart <command|dart-file> [arguments]
[SEVERE] 
[SEVERE] Global options:
[SEVERE] -v, --verbose               Show additional command output.
[SEVERE]     --version               Print the Dart SDK version.
[SEVERE]     --enable-analytics      Enable analytics.
[SEVERE]     --disable-analytics     Disable analytics.
[SEVERE]     --suppress-analytics    Disallow analytics for this `dart *` run without changing the analytics configuration.
[SEVERE] -h, --help                  Print this usage information.
[SEVERE] 
[SEVERE] Available commands:
[SEVERE]   analyze    Analyze Dart code in a directory.
[SEVERE]   compile    Compile Dart to various formats.
[SEVERE]   create     Create a new Dart project.
[SEVERE]   devtools   Open DevTools (optionally connecting to an existing application).
[SEVERE]   doc        Generate API documentation for Dart projects.
[SEVERE]   fix        Apply automated fixes to Dart source code.
[SEVERE]   format     Idiomatically format Dart source code.
[SEVERE]   info       Show diagnostic information about the installed tooling.
[SEVERE]   pub        Work with packages.
[SEVERE]   run        Run a Dart program.
[SEVERE]   test       Run tests for a project.
[SEVERE] 
[SEVERE] Run "dart help <command>" for more information about a command.
[SEVERE] See https://dart.dev/tools/dart-tool for detailed documentation.
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
[SEVERE] This is likely caused by a misconfigured builder definition.
[SEVERE] 
Unhandled exception:
Bad state: Unable to start build daemon.
#0      _handleDaemonStartup.<anonymous closure> (package:build_daemon/client.dart:79:21)
#1      _runUserCode (dart:async/stream_pipe.dart:11:23)
#2      Stream.firstWhere.<anonymous closure> (dart:async/stream.dart:1708:9)
#3      _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#4      _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:418:13)
#5      _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:428:7)
#6      _BufferingStreamSubscription._close (dart:async/stream_impl.dart:317:7)
#7      _SyncBroadcastStreamController._sendDone.<anonymous closure> (dart:async/broadcast_stream_controller.dart:399:22)
#8      _BroadcastStreamController._forEachListener (dart:async/broadcast_stream_controller.dart:322:15)
#9      _SyncBroadcastStreamController._sendDone (dart:async/broadcast_stream_controller.dart:398:7)
#10     _BroadcastStreamController.close (dart:async/broadcast_stream_controller.dart:268:5)
#11     _AsBroadcastStreamController.close (dart:async/broadcast_stream_controller.dart:505:24)
#12     _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#13     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:418:13)
#14     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:428:7)
#15     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:317:7)
#16     _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
#17     _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
#18     _StringAdapterSink.close (dart:convert/string_conversion.dart:241:11)
#19     _LineSplitterSink.close (dart:convert/line_splitter.dart:141:11)
#20     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
#21     _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#22     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:418:13)
#23     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:428:7)
#24     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:317:7)
#25     _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
#26     _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
#27     _StringAdapterSink.close (dart:convert/string_conversion.dart:241:11)
#28     _Utf8ConversionSink.close (dart:convert/string_conversion.dart:295:20)
#29     _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:78:18)
#30     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
#31     _RootZone.runGuarded (dart:async/zone.dart:1582:10)
#32     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:418:13)
#33     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:428:7)
#34     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:317:7)
#35     _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:792:19)
#36     _StreamController._closeUnchecked (dart:async/stream_controller.dart:647:7)
#37     _StreamController.close (dart:async/stream_controller.dart:640:5)
#38     _Socket._onData (dart:io-patch/socket_patch.dart:2462:21)
#39     _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
#40     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:365:11)
#41     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:297:7)
#42     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
#43     _StreamController._add (dart:async/stream_controller.dart:658:7)
#44     _StreamController.add (dart:async/stream_controller.dart:606:5)
#45     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1949:35)
#46     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1378:18)
#47     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
#48     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
#49     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#50     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)

Need help! Thanks.

@dart-github-bot
Copy link
Collaborator

Summary: The user is experiencing an error when running webdev serve after upgrading to Dart 3.5.0. The error message indicates that the frontend_server.dart.snapshot file cannot be found, which is likely due to a misconfigured builder definition.

@dart-github-bot dart-github-bot added area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Aug 6, 2024
@ailabs-software
Copy link
Author

ailabs-software commented Aug 6, 2024

I have temporarily downgraded back to dart@3.4.4 to get webdev working again on our machines.

I also tried deleting the .dart_tool/ directory, but that didn't help.

@gmpassos
Copy link
Contributor

gmpassos commented Aug 7, 2024

Try to run:

dart pub global activate webdev

Here it's working:

Dart SDK version: 3.5.0 (stable) (Tue Jul 30 02:17:59 2024 -0700) on "macos_x64"
Darwin 21.6.0 Darwin Kernel Version 21.6.0

@lrhn lrhn added os-osx web-dev-compiler area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. and removed area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. labels Aug 7, 2024
@jakemac53
Copy link
Contributor

Specifically you need to upgrade the transitive frontend_server_client dependency of the globally activated webdev package. The only way to do this, is as @gmpassos suggests re-activating the package dart pub global activate webdev. That will resolve the issue.

@bkonyi
Copy link
Contributor

bkonyi commented Aug 7, 2024

Thanks @jakemac53! I was literally about to post the same response :)

For some context, we've migrated a lot of our tooling to start the frontend_server using the Dart precompiled runtime, whereas before we were launching it with the just-in-time VM from a snapshot. Dart 3.5.0 removed the frontend_server.dart.snapshot from the SDK and replaced it with frontend_server_aot.dart.snapshot.

@ailabs-software
Copy link
Author

That worked. Awesome everyone!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. os-osx type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dev-compiler
Projects
None yet
Development

No branches or pull requests

6 participants