Angular: Unhandled exception in the AngularDart compiler!

Created on 18 May 2018  路  8Comments  路  Source: angulardart/angular

Dart VM version: 2.0.0-dev.53.0 (Thu May 3 12:35:47 2018 +0200) on "macos_x64"

NoSuchMethodError: Class 'CompilerFlags' has no instance getter 'useNewPreserveWhitespace'.
Receiver: Instance of 'CompilerFlags'
Tried calling: useNewPreserveWhitespace

Run on Webstorm and cmdline same error.

Thank you for taking the time to file an issue!

In order to route, prioritize, and act on this as soon as possible please include:

  • [ ] Dart SDK Version (dart --version)
  • [ ] AngularDart Version (i.e. 4.0.0, 5.0.0-alpha+5, MASTER)
  • [ ] Whether you are using Windows, MacOSX, or Linux (if applicable)
  • [ ] Whether you are using Chrome, Safari, Firefox, Edge (if appplicable)
  • [ ] Any other packages or constraints we should know about

Missing some or all of the above might make the issue take longer or be impossible to act on.


For questions consider using Stack Overflow instead:
https://stackoverflow.com/questions/tagged/angular-dart

Also consider our Gitter channel for light-weight/quick discussions:
https://gitter.im/dart-lang/angular


All 8 comments

Current version is 5.0.0-alpha+12. Could you try with that version?
Perhaps you need to limit the angular_compiler version to an older version.

@deaitch Are you use angular_components package?

I'm having this error, and I am using the angular components package, version 0.9.0-alpha+11.

I constrained angular_compiler to 0.4.0-alpha+11 and now I can build again.

That is the right way to go atm, and it is what we've done for the stagehand templates. See https://github.com/dart-lang/stagehand/blob/2d142bda55c04735ea9bfd8fecae14690833da6f/templates/web-angular/pubspec.yaml#L24:

dependency_overrides:
  # Needed to ensure 0.4.0-alpha+12 (or greater) is not accessed
  # https://github.com/dart-lang/stagehand/issues/506
  angular_compiler: 0.4.0-alpha+11

Related: https://github.com/dart-lang/stagehand/issues/506

FYI I just pushed a PR for an updated angular_components release.
https://github.com/dart-lang/angular_components/pull/265

I published angular_components v0.9.0-alpha+12 that should allow the version solve to get the newest version of angular that works with angular_compiler v0.4.0-alpha+12

@nshahan appears to be the solution.Thank you and closing issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AndreyChernykh picture AndreyChernykh  路  4Comments

double11one picture double11one  路  6Comments

zoechi picture zoechi  路  5Comments

ranquild picture ranquild  路  6Comments

ranquild picture ranquild  路  4Comments