angular
angular copied to clipboard
Incompatible with latest version of Analyzer
None of the recent versions of the Angular package are compatible with the latest version of the Analyzer package 0.39.2+1
.
pub get update
shows:
Because angular >= depends on analyzer ^0.37.0 and auge_web depends on analyzer ^0.39.2+1, angular >=6.0.0-alpha+1 is forbidden. So, because auge_web depends on angular ^6.0.0-alpha+1, version solving failed.
- Dart SDK Version (
dart --version
) 2.7 - AngularDart Version 6.0.0-alpha+1
- Whether you are using Windows, macOS, or Linux Windows
- Whether you are using Chrome, Safari, Firefox, Edge Chrome
As mentioned in https://github.com/dart-lang/angular/issues/1860#issuecomment-565643006, you can use dependency_overrides
to override the analyzer constraint.
@leonsenft: FYI: While the overrides may work in many cases, there were a few non-trivial changes between package:analyzer
0.37 and 0.39, and for a non-angular use-case we had breaking changes when doing the override.
Overriding analyzer is not the magic solution as it breaks some others packages on build. In my project, I tried many times but impossible to use analyzer> 0.38.3 Hope you'll upgrade Angular to be compatible with analyzer 0.39+ soon
@leonsenft Updating to analyzer ^0.39.0 with dependency_overrides
fails on webdev build
with the following error:
[SEVERE] ../../../.pub-cache/hosted/pub.dartlang.org/angular-6.0.0-alpha+1/lib/src/compiler/analyzed_class.dart:64:15: Error: The method 'isEquivalentTo' isn't defined for the class 'DartType'. - 'DartType' is from 'package:analyzer/dart/element/type.dart' ('../../../.pub-cache/hosted/pub.dartlang.org/analyzer-0.39.8/lib/dart/element/type.dart').Try correcting the name to the name of an existing method, or defining a method named 'isEquivalentTo'. return type.isEquivalentTo(string);
Unhandled exception:
Bad state: Unable to start build daemon.
#0 _handleDaemonStartup (package:build_daemon/client.dart:82:5)
<asynchronous suspension>
#1 BuildDaemonClient.connect (package:build_daemon/client.dart:183:11)
<asynchronous suspension>
#2 connectClient (package:webdev/src/daemon_client.dart:17:23)
#3 _startBuildDaemon (package:webdev/src/serve/dev_workflow.dart:26:18)
#4 DevWorkflow.start (package:webdev/src/serve/dev_workflow.dart:194:24)
#5 ServeCommand.run (package:webdev/src/command/serve_command.dart:101:27)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#7 _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:38:24)
#8 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#9 new Future.sync (dart:async/future.dart:224:31)
Angular (5.3.1)
We can't update builder libraries with important fixes for us because they depend on the latest analyzer version. And angular doesn't compile with this analyzer version.
[SEVERE] angular:angular on lib/src/smth.dart: Unhandled exception in the AngularDart compiler!
Please report a bug: https://github.com/dart-lang/angular/issues/newBad state: Provider.useFactory must be a Function, but got type Smth Function() instead with type element null
...
This problem is becoming more pressing every day. Developers outside of Google are from now on basically bound to the SDK version <dart-sdk 2.14.0-91.0.dev because angular 6.0.1 depends on analyzer ^0.40.0
See also https://github.com/dart-lang/sdk/issues/46482
dependency_overrides:
analyzer: ^1.0.0
Working dir: D:\dart-apps\webV\gdv\gdv_app
"D:\dart-sdk\dart-sdk 2.14.0-241.0.dev\bin\dart.exe" pub get
Resolving dependencies...
Because analyzer >=1.0.0 depends on package_config ^2.0.0 and angular_compiler 1.0.1 depends on package_config ^1.9.3, analyzer >=1.0.0 is incompatible with angular_compiler 1.0.1.
And because angular 6.0.1 depends on angular_compiler 1.0.1 and no versions of angular match >6.0.1 <7.0.0, analyzer >=1.0.0 is incompatible with angular ^6.0.1.
So, because gdv_app depends on both angular ^6.0.1 and analyzer ^1.0.0, version solving failed.