Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

unable to find mobules for some sources #1913

Open
jodinathan opened this issue Sep 17, 2020 · 2 comments
Open

unable to find mobules for some sources #1913

jodinathan opened this issue Sep 17, 2020 · 2 comments

Comments

@jodinathan
Copy link

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
Copy link
Author

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant