Giovanni Silva
Giovanni Silva

Reputation: 714

Could someone explain Exception: Module.DEFAULT_REFLECTOR not initialized for dependency

I'm get this error with a angular 1.0.0 project and I don't know what this means and what should be done. I do not understand the explanation in link https://github.com/angular/di.dart/wiki/Uninitialized-Module.DEFAULT_REFLECTOR-error

My project declare one dependency in a library that declares a dependency in angular. So my project doesn't have a direct dependency in angular and I can't declare transformers in the pubspec.yaml file.

Upvotes: 1

Views: 166

Answers (2)

Mike Mitterer
Mike Mitterer

Reputation: 7170

I got the same error when I was using main() async - so removing the async and going back to the conventional Future-base version was the solution.

I filed an issue report: https://github.com/angular/di.dart/issues/221

Upvotes: 1

Giovanni Silva
Giovanni Silva

Reputation: 714

Angular now use static generated content. The html files for components are processed during pub install or pub serve

The pubspec.yaml file needs something like:

transformers:
- angular:
    html_files:
    - web/controllers/error_warning_controller.html
    - web/controllers/http_interceptor_controller.html
    - web/controllers/notify_tray_controller.html
    - web/controllers/notify_desktop.html
    - web/controllers/panel_controller.html
    - web/controllers/window_controller.html
    dart_sdk: /usr/local/opt/dart/libexec

Also it not work if you use a library that depends on angular you need a direct dependency for angular transform to work, I work around declaring the dependency twice, one for the library one for the project that use the library.

Upvotes: 0

Related Questions