Angular: Incompatible with latest version of Analyzer

Created on 16 Dec 2019  路  5Comments  路  Source: angulardart/angular

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

All 5 comments

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
...
Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndreyChernykh picture AndreyChernykh  路  4Comments

luisvt picture luisvt  路  5Comments

matanlurey picture matanlurey  路  3Comments

mandreyel picture mandreyel  路  6Comments

zoechi picture zoechi  路  5Comments