angulardart / angular

Fast and productive web framework provided by Dart
https://pub.dev/packages/angular
MIT License
1.83k stars 233 forks source link

unable to find mobules for some sources #1913

Open jodinathan opened 3 years ago

jodinathan commented 3 years ago

dart 2.9.3 angular 5.3.1

out of nowhere I can't serve or build a project. it basically gives you no clue of what is happening.

[WARNING]angular:angular on lib/wizard/wizard.dart: Compiling @Component-annotated class "OniWizardComponent" failed.

Try the following when diagnosing the problem:
  * Check your IDE or with the dartanalyzer for errors or warnings
  * Check your "import" statements for missing or incorrect URLs

If you are still stuck, file an issue and include this error message:
https://github.com/dart-lang/angular/issues/new

[SEVERE]angular:angular on lib/wizard/wizard.dart: Compiling @Component-annotated class "OniWizardComponent" failed.

Try the following when diagnosing the problem:
  * Check your IDE or with the dartanalyzer for errors or warnings
  * Check your "import" statements for missing or incorrect URLs

If you are still stuck, file an issue and include this error message:
https://github.com/dart-lang/angular/issues/new

[SEVERE]build_web_compilers:entrypoint on web/main.dart: Unable to find modules for some sources, this is usually the result of either a
bad import, a missing dependency in a package (or possibly a dev_dependency
needs to move to a real dependency), or a build failure (if importing a
generated file).

Please check the following imports:

`import 'package:guaraci_admin/wizard/wizard.template.dart' as _ref3;` from guaraci_admin|lib/layouts/admin/wizards/wizard.template.dart at 10:1
`import 'package:guaraci_admin/wizard/wizard.template.dart' as _ref6;` from guaraci_admin|lib/app_component.template.dart at 14:1
`import 'package:guaraci_admin/wizard/wizard.template.dart' as _ref17;` from guaraci_admin|lib/layouts/admin/admin_layout_component.template.dart at 25:1

[INFO] Running build completed, took 33.3s
[INFO] Caching finalized dependency graph completed, took 1.2s
[SEVERE] Failed after 34.5s
[SEVERE] FailureType: 1
jodinathan commented 3 years ago

in the directory .dart_tool/build/generated/guaraci_admin/lib/wizard I have: // wizard.dart2js.module, wizard.ddc.module, wizard.module.library, // wizard.ng_placeholder, wizard.scss.css, wizard.scss.css.dart // wizard.scss.css.module.lib, wizard.scss.css.shim.dart // wizard.scss.css.shim.module.library

but not the wizard.template.dart.

jodinathan commented 3 years ago

Found the bug. I was using exports: [List] so I could use List.filled(5, null) in the template. It is not the exports itself, because I am still using exports: [RelativePosition] and it is compiling. As I have an extension on List I added a simple extension to RelativePosition to test:

extension AdvRelativePosition on RelativePosition {
  bool yes() => 1 > 0;
}

the compiler did not like it:

[SEVERE] build_web_compilers:ddc on package:guaraci_front/wizard/wizard.template.ddc.module:
Error compiling dartdevc module:guaraci_front|lib/wizard/wizard.template.ddc.js

packages/guaraci_front/wizard/wizard.template.dart:831:31: Error: Getter not found: 'RelativePosition'.
    final currVal_2 = import2.RelativePosition.AdjacentBottomEdge;
                              ^^^^^^^^^^^^^^^^

[WARNING] build_web_compilers:entrypoint on web/main.dart:
Unable to read guaraci_front|lib/wizard/wizard.template.ddc.js, check your console or the `.dart_tool/build/generated/guaraci_front/lib/wizard/wizard.template.ddc.js.errors` log file.
[SEVERE] build_web_compilers:entrypoint on web/main.dart:

AssetNotFoundException: guaraci_front|lib/wizard/wizard.template.ddc.js

I am guessing that the compiler was able to tell me the problem in this case because the extension is in the same file as the component.

Silent bugs... cries