Skip to content

AngularDart not working #3481

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

Closed
AdityaKha opened this issue Apr 3, 2023 · 11 comments
Closed

AngularDart not working #3481

AdityaKha opened this issue Apr 3, 2023 · 11 comments
Assignees

Comments

@AdityaKha
Copy link

khandelwaladitya5@penguin:~/quickstart-master$ webdev serve
[INFO] ../.pub-cache/hosted/pub.dev/build_modules-4.0.6/lib/src/module_cache.dart:21:70: Error: The method 'toJson' isn't defined for the class
[INFO] ../.pub-cache/hosted/pub.dev/build_modules-4.0.6/lib/src/module_cache.dart:24:66: Error: The method 'toJson' isn't defined for the class
[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. (package:build_daemon/client.dart:79:21)
dart-lang/sdk#1 _runUserCode (dart:async/stream_pipe.dart:11:23)
dart-lang/sdk#2 Stream.firstWhere. (dart:async/stream.dart:1704:9)
dart-lang/sdk#3 _RootZone.runGuarded (dart:async/zone.dart:1581:10)
dart-lang/sdk#4 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
dart-lang/sdk#5 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
dart-lang/sdk#6 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
dart-lang/sdk#7 _SyncBroadcastStreamController._sendDone. (dart:async/broadcast_stream_controller.dart:399:22)
dart-lang/sdk#8 _BroadcastStreamController._forEachListener (dart:async/broadcast_stream_controller.dart:322:15)
dart-lang/sdk#9 _SyncBroadcastStreamController._sendDone (dart:async/broadcast_stream_controller.dart:398:7)
dart-lang/sdk#10 _BroadcastStreamController.close (dart:async/broadcast_stream_controller.dart:268:5)
dart-lang/sdk#11 _AsBroadcastStreamController.close (dart:async/broadcast_stream_controller.dart:505:27)
dart-lang/sdk#12 _RootZone.runGuarded (dart:async/zone.dart:1581:10)
dart-lang/sdk#13 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
dart-lang/sdk#14 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
dart-lang/sdk#15 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
dart-lang/sdk#16 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
dart-lang/sdk#17 _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
dart-lang/sdk#18 _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
dart-lang/sdk#19 _LineSplitterSink.close (dart:convert/line_splitter.dart:137:11)
dart-lang/sdk#20 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
dart-lang/sdk#21 _RootZone.runGuarded (dart:async/zone.dart:1581:10)
dart-lang/sdk#22 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
dart-lang/sdk#23 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
dart-lang/sdk#24 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
dart-lang/sdk#25 _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:87:11)
dart-lang/sdk#26 _EventSinkWrapper.close (dart:async/stream_transformers.dart:21:11)
dart-lang/sdk#27 _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
dart-lang/sdk#28 _Utf8ConversionSink.close (dart:convert/string_conversion.dart:305:20)
dart-lang/sdk#29 _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:81:18)
dart-lang/sdk#30 _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:132:24)
dart-lang/sdk#31 _RootZone.runGuarded (dart:async/zone.dart:1581:10)
dart-lang/sdk#32 _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:392:13)
dart-lang/sdk#33 _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:402:7)
dart-lang/sdk#34 _BufferingStreamSubscription._close (dart:async/stream_impl.dart:291:7)
dart-lang/sdk#35 _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:782:19)
dart-lang/sdk#36 _StreamController._closeUnchecked (dart:async/stream_controller.dart:637:7)
dart-lang/sdk#37 _StreamController.close (dart:async/stream_controller.dart:630:5)
dart-lang/sdk#38 _Socket._onData (dart:io-patch/socket_patch.dart:2362:21)
dart-lang/sdk#39 _RootZone.runUnaryGuarded (dart:async/zone.dart:1593:10)
dart-lang/sdk#40 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
dart-lang/sdk#41 _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
dart-lang/sdk#42 _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:774:19)
dart-lang/sdk#43 _StreamController._add (dart:async/stream_controller.dart:648:7)
dart-lang/sdk#44 _StreamController.add (dart:async/stream_controller.dart:596:5)
dart-lang/sdk#45 new _RawSocket. (dart:io-patch/socket_patch.dart:1884:35)
dart-lang/sdk#46 _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1327:18)
dart-lang/sdk#47 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
dart-lang/sdk#48 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
dart-lang/sdk#49 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:123:13)
dart-lang/sdk#50 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:5)

@jakemac53 jakemac53 transferred this issue from dart-lang/sdk Apr 3, 2023
@jakemac53
Copy link
Contributor

@AdityaKha do you have any dependency_overrides in your pubspec.yaml?

@jakemac53
Copy link
Contributor

Actually I can definitely reproduce this on build_modules version 4.0.6 and the latest SDK. It feels familiar also 🤔

@jakemac53
Copy link
Contributor

@AdityaKha can you try upgrading to build_modules version 4.0.7? It appears that changing the lower bound of the SDK constraint to 2.18.0 fixes this, which did happen in 4.0.7. I assume some inference behavior changed. Not entirely sure how we were able to pass analysis checks for 4.0.6 though at the time.

@jakemac53
Copy link
Contributor

Ok, so digging a bit more here, this is not an error on the latest stable release. It is only an error on dev.

cc @stereotype441 do you know of a change to inference, where changing a language version from 2.14 to 2.18 would affect behavior, but only on a 3.0 dev SDK?

@jakemac53
Copy link
Contributor

Fwiw the affected lines here are https://github.com/dart-lang/build/blob/master/build_modules/lib/src/module_cache.dart#L21 and https://github.com/dart-lang/build/blob/master/build_modules/lib/src/module_cache.dart#L24.

These don't infer the MetaModule type for the generic type parameter on DecodingCache.resource. Instead they get just Object?.

@jakemac53
Copy link
Contributor

Full straightforward repro instructions are as follows:

On the current dev sdk 3.0.0-375.0.dev

This will produce errors similar to above (although slightly different).

  • modify the build_modules/pubspec.yaml file so the min sdk constraint is >=2.18.0
  • dart pub get
  • dart analyze .

No errors

@jakemac53
Copy link
Contributor

dart-lang/sdk#51128 according to this it was happening on 2.19 stable also, not sure why I wasn't seeing that...

But I am going to close this as a duplicate actually.

@jakemac53
Copy link
Contributor

@AdityaKha let us know if you cannot migrate to version 4.0.7 for some reason (analyzer?). If so we have the possibility of backporting a 4.0.6+1 release with the increased min sdk constraint, which should resolve the issue was well.

@DmtrY94
Copy link

DmtrY94 commented Jul 25, 2024

@jakemac53 Hi! I am currently migrating the AngularDart project from SDK version 2.10 to 2.19.6 and ngdart 7.1.1. I encountered the same error and couldn't upgrade to 4.0.7. Could you please provide version 4.0.6+1 as mentioned above?

@jakemac53
Copy link
Contributor

@DmtrY94 done

@DmtrY94
Copy link

DmtrY94 commented Jul 25, 2024

@jakemac53 Thank you

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants