Hi everybody,
I'm new to AngularDart and I'm trying to play a bit with Firebase.
I'm getting this error everytime I try to compile
[INFO] Caching finalized dependency graph completed, took 562ms
[SEVERE] build_web_compilers|entrypoint on web/main.dart (cached):
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:ganizr/app_component.template.dart' as ng; from ganizr|web/main.dart at 4:1
[SEVERE] Failed after 1.6s
My pubspec.yaml
name: ganizr
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
# author: double11one <[email protected]>
version: 0.0.1
environment:
sdk: '>=2.0.0 <3.0.0'
dependencies:
angular: ^5.0.0
angular_forms: ^2.0.0
angular_router: ^2.0.0-alpha+19
http: ^0.11.0
stream_transform: ^0.0.6
firebase: ^5.0.0
googleapis_auth: ^0.2.5
service_worker: ^0.2.3
dev_dependencies:
angular_test: ^2.0.0
build_runner: ^0.10.0
build_test: ^0.10.2
build_web_compilers: ^0.4.0
test: ^1.0.0
analyzer:
errors:
uri_has_not_been_generated: ignore
My main.dart
import 'package:angular/angular.dart';
import 'package:firebase/firebase.dart';
import 'package:ganizr/app_component.template.dart' as ng;
void main() {
initializeApp(
apiKey: "***",
authDomain: "***",
databaseURL: "***",
storageBucket: "***",
messagingSenderId: "***",
projectId: "***",
);
runApp(ng.AppComponentNgFactory);
}
app_component.dart
import 'package:angular/angular.dart';
import 'src/data_service.dart';
@Component(
selector: 'app',
templateUrl: "app_component.html",
styleUrls: ['app_component.css'],
providers: [DataService],
)
class AppComponent implements OnInit {
final title = 'Orders';
final DataService _dataService;
bool get isServiceLoading => _dataService.loading;
AppComponent(this._dataService);
@override
ngOnInit() {
_dataService.init();
}
}
Don't know what I'm doing wrong.
Thank in advance.
Dart SDK Version: 2.0.0
Angular: 5.0.0
macos_x64
@double11one Where are your files relative to each other? Does your package structure look like this?
pubspec.yaml
lib/
app_component.dart
web/
main.dart
@leonsenft yes, exactly.
Sometimes an earlier failure that is responsible for the missing file isn't shown on repeated compilation, so perhaps there's another error you missed. Could you please try the following:
Upgrade your dependencies:
pub upgrade
Clean out the generated code
pub run build_runner clean
Try compiling again and see if there are any new errors
pub run build_runner serve
Ok, got it. I removed the deprecated CORE_DIRECTIVES without adding the coreDirectives one.
Thanks for the help!
@jakemac53 @natebosch I think you already have an issue tracking this, but this seems to be a common issue users experience with build_runner: an earlier error that prevents the generation of a file isn't shown again on repeat compilations.
We do now show errors on repeat compilations by default - but only in more recent versions of build_runner, so hopefully this sort of confusion becomes less prevalent as people upgrade.
Most helpful comment
Sometimes an earlier failure that is responsible for the missing file isn't shown on repeated compilation, so perhaps there's another error you missed. Could you please try the following:
Upgrade your dependencies:
Clean out the generated code
Try compiling again and see if there are any new errors