1
votes

I'm 3 months new into dart and I've been fairly lucky not to have encountered any issues that couldn't be fixed from answers found on the net, but this one has stumped me.

I downloaded this sample app (https://github.com/vsavkin/angulardart-sample-app) installed it into dart-editor (on my mac mini) using Open Existing Folder and then running get Pub Get (or even Pub Update) on the pubspec.yaml file.

I was getting dartium loading with a running app until I upgraded the SDK from 1.4.2 to 1.5.8 and the pubspec.yaml file from

environment:
sdk: '>=1.4.2 <2.0.0' to

environment:
sdk: '>=1.5.8 <2.0.0'

where everything just broke and i am now getting these types of errors in dartium which I'd like to know how to fix (reverting hasn't helped, 404's are still present - is there some old cache that's being read that I can't find?):

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/packages/shadow_dom/shadow_dom.min.js

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/routing/static_keys.dart An error occurred loading file: package:angular/routing/static_keys.dart package:angular/routing/static_keys.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/cache/module.dart An error occurred loading file: package:angular/cache/module.dart package:angular/cache/module.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/core_dom/directive_injector.dart An error occurred loading file: package:angular/core_dom/directive_injector.dart package:angular/core_dom/directive_injector.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/cache/js_cache_register.dart An error occurred loading file: package:angular/cache/js_cache_register.dart package:angular/cache/js_cache_register.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/directive/static_keys.dart An error occurred loading file: package:angular/directive/static_keys.dart package:angular/directive/static_keys.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/core/static_keys.dart An error occurred loading file: package:angular/core/static_keys.dart package:angular/core/static_keys.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/di/src/reflector.dart An error occurred loading file: package:di/src/reflector.dart package:di/src/reflector.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/change_detection/ast_parser.dart An error occurred loading file: package:angular/change_detection/ast_parser.dart package:angular/change_detection/ast_parser.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/angular/core_dom/compiler_config.dart An error occurred loading file: package:angular/core_dom/compiler_config.dart package:angular/core_dom/compiler_config.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/di/check_bind_args.dart An error occurred loading file: package:di/check_bind_args.dart package:di/check_bind_args.dart:1

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:63342/aa-app/web/packages/di/src/reflector_dynamic.dart An error occurred loading file: package:di/src/reflector_dynamic.dart package:di/src/reflector_dynamic.dart:1

Have tried starting from scratch Have tried different versions of the angular package ie version 11.0, 12.0, 13.0 Have tried different versions of SDK from 1.4.2 to 1.5.3 to 1.5.8 still the same output

What on earth have i done to ruin something that was working so slickly?

1
I had just a brief glance. The shadow_dom package is deprecated since several months. Use web_components instead. Are you using IntelliJ IDEA/WebStorm? Try running pub serve and load the file from http://localhost:8080/index.html (for web/index.html file).Günter Zöchbauer
i removed shadow_dom but it is still showing up in the 404 errorsCoding Optimist
I didn't expect this to solve your problem but I hadn't more time. You haven't yet answered if you are using DartEditor or a WebStorm. The port 63342 and the path shown by your error messages is uncommon for DartEditor.Günter Zöchbauer
Sorry not used to this. first time in Stackoverflow... Yes I am using intelliJ Webstorm, but I am also using the dart editor too especially for debugging. I removed shadow_dom and run upgrade (using dart-editor), but it is still showing up in the 404 errors along with all those others. And when dartium now loads I get this message (having gone back to 1.4.2 from 1.5.8) Your profile can not be used because it is from a newer version of Chromium. Some features may be unavailable. Please specify a different profile directory or use a newer version of Chromium. I broken everything it seems.Coding Optimist
No good, still the same error eventhough new DynamicTypeFactories() is being found by the import 'package:di/src/reflector_dynamic.dart';: Exception: Module.DEFAULT_REFLECTOR not initialized for dependency injection.goo.gl/XFXx9G (package:di/src/reflector_null.dart:11) Breaking on exception: Module.DEFAULT_REFLECTOR not initialized for dependency injection.goo.gl/XFXx9G Going to file that bug report. Thanks for all your help though and lightening fast responses... appreciatedCoding Optimist

1 Answers

1
votes

The error "Module.DEFAULT_REFLECTOR not initialized" is thrown because the di transformer is not executed.

You need to add the anfular transformer to your pubspec.yaml (which includes the di transformer)