I am working with latest version of angular.dart and my pubspec.yaml looks somewhat like this:
name: angularApp
dependencies:
angular:
git: 'git#github.com:angular/angular.dart'
third_party_angular_plugin: any
the problem is third_party_angular_plugin is depending on stable version of angular.dart. I tried to specify as follows:
name: angularApp
dependencies:
angular:
git: 'git#github.com:angular/angular.dart'
third_party_angular_plugin: any
dependency_overrides:
angular:
version: ">=0.9.10"
But it throws a weird error saying Bad State: No elements dart:core List.single ....
How can I override third_party_angular_plugin's dependency on angular for my app?
The version is not a separate nested key, as per the example on Pub Dependencies page, the right format is this:
name: angularApp
dependencies:
angular:
git: 'git#github.com:angular/angular.dart'
third_party_angular_plugin: any
dependency_overrides:
angular: ">=0.9.10"
Related
I was trying to download packages and run command pub get when the error Connection closed before full header was received exit code 69. So I tried to use VPN, because I thought it was because of my network. Then I saw this:
Screenshot
I don't have any anti-virus, so what do I do?
NOTE: I'm not using Flutter
pubspec.yaml
name: dart_application_2
description: A sample command-line application.
version: 1.0.0
# homepage: https://www.example.com
environment:
sdk: '>=2.17.5 <3.0.0'
# dependencies:
# path: ^1.8.0
dev_dependencies:
lints: ^2.0.0
test: ^1.16.0
Today I started trying advice from #matanlurey in git#676 (https://github.com/dart-lang/angular/issues/676). In my project pubspec.yaml file:
environment:
sdk: '>=1.24.0 <2.0.0'
dependencies:
angular: ^5.0.0-alpha
angular_components: ^0.9.0-alpha
angular_forms: ^1.0.1-alpha
angular_router: ^2.0.0-alpha
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
sass_builder: ^1.0.0
but Resolving dependencies...
Incompatible version constraints on angular:
- angular_components 0.9.0-alpha depends on version 5.0.0-alpha
- angular_forms 1.0.1-alpha depends on version ^5.0.0-alpha
- angular_router 2.0.0-alpha depends on version ^4.0.0
- huastecappadmin depends on version ^5.0.0-alpha
Process finished with exit code 1
Any Idea?
You can try to add
dependency_overrides:
angular: ^5.0.0-alpha
but it might not work.
In this case you'd need to wait until an update for angular_router that is compatible with Angular 5 is released.
See also https://github.com/dart-lang/angular/issues/676
I just started learning dart.
first I created an angular2-dart based project from https://angular.io/docs/dart/latest/quickstart.html and it worked properly.
now I want to add auth0-lock dart package from https://pub.dartlang.org/packages/auth0_lock, so I modified pubspec.yaml to the following:
name: go_dart_angular2_zingchart
description: Go Dart Angular2 with ZingChart Started Kit
version: 0.0.1
environment:
sdk: '>=1.13.0 <2.0.0'
dependencies:
angular2: ^2.0.0-beta.18
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
auth0_lock: ^0.1.0
transformers:
- angular2:
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
entry_points: client/web/main.dart
- dart_to_js_script_rewriter
and now when I execute pub get I get the following error:
Error on line 15, column 3 of ../../../.pub-cache/hosted/pub.dartlang.org/auth0_lock-0.1.0/pubspec.yaml: Error loading transformer "dart_to_js_script_rewriter": package "dart_to_js_script_rewriter" is not a dependency.
- dart_to_js_script_rewriter
^^^^^^^^^^^^^^^^^^^^^^^^^^
since I'm new to dart and not entirely sure what I'm doing.. I have no idea how to fix this :)
any ideas ?
thanks!
I get the same error when adding auth0_lock: ^0.1.0 to my dependencies and running pub get. The error message says that "dart_to_js_script_rewriter" is not a dependency in the pubspec.yaml of the auth0_lock package. It looks like it's added under dev_dependecies if you look here. Dev dependencies of any dependent packages are ignored. Pub only gets your package’s dev dependencies.
So I think this is a problem in their package.
So, what I did was I went to https://github.com/andresaraujo/auth0_lock.dart and cloned the package, added it into my own project root in a directory called auth0_lock. And then, in my pubspec.yaml i put:
auth0_lock:
path: auth0_lock
After that I can import it using
import 'package:auth0_lock/auth0_lock.dart';
I created new polymer dart project with dependences:
dependencies:
polymer: ^1.0.0-rc.2
web_components: ^0.12.0
polymer_elements: ^1.0.0-rc.1
browser: ^0.10.0
reflectable: ^0.3.1
dependency_overrides:
polymer_interop:
git:
ref: 0.2.0-rc1
url: https://github.com/dart-lang/polymer_interop.git
and everything worked fine (I can create new dom-module and use polymer elements). But then I tried to use exactly the same dependency configuration in existing project and when I run pub get I get:
Package reflectable has no versions that match >=0.3.1 <0.4.0 derived from:
- fbnn depends on version ^0.3.1
- polymer 1.0.0-rc.2 depends on version ^0.3.1
- polymer_elements 1.0.0-rc.1 depends on version ^0.3.1
I also try to do pub cache repair but it didn't help. Any ideas what might be wrong?
I am trying to get packages from the PUB with the following:
name: 'ch_padart'
version: 0.0.1
dependencies:
angular: "1.1.0"
angular_node_bind: any
polymer: ">=0.15.5+2 <0.16.0"
core_elements: ">=0.6.0+4 <0.7.0"
paper_elements: ">=0.6.1 <0.7.0"
web_components: ">=0.9.0 <0.11.0"
browser: ">=0.10.0+2 <0.11.0"
dev_dependencies:
unittest: ">=0.11.0+5 <0.12.0"
mock: ">=0.11.0+2 <0.12.0"
transformers:
- angular:
html_files:
- web/index.html
- polymer:
entry_points: web/index.html
lint: false
but the end result is always 'Connection closed before full header was received'
If you remove angular OR polymer (and elements) and then run pub get, there is no issue and all download and runs fine. No other warnings are displayed and --verbose yields nothing helpful that I can see.
When you run pub get -v from command line you will see that pub is working quite hard but can't find a compatible set of dependencies. There was a similar issue recently that the I guess the collection package was required in different dependencies with non-overlapping version constraints.
This is quite common when using Angular with Polymer.
You might need to investigate the dependencies manually to find the cause.
Maybe you get some feedback from pub get when you remove all dependency constraints and then start adding them again one by one.
the pubviz packages helps to resolve this kind of issue as well: https://pub.dartlang.org/packages/pubviz