Error: The non-abstract class 'ChromeProxyService' is missing implementations for these members: - dart

I did a pub build this morning and all of a sudden, something that was compiling fine yesterday, with no changes today, is breaking.
Failed to precompile webdev:webdev:
../../../.pub-cache/hosted/pub.dartlang.org/dwds-3.1.3/lib/src/services/chrome_proxy_service.dart:40:7: Error: The non-abstract class 'ChromeProxyService' is missing implementations for these members:
- VmServiceInterface.getSupportedProtocols
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class ChromeProxyService implements VmServiceInterface {
^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/vm_service-4.1.0/lib/src/vm_service.dart:745:24: Context: 'VmServiceInterface.getSupportedProtocols' is defined here.
Future<ProtocolList> getSupportedProtocols();
^^^^^^^^^^^^^^^^^^^^^
Precompiling executables... (1.9s)
I've done a cache repair, another get to see if there are newer versions, I've done an upgrade just to be sure, but as soon as I hit activate webdev, I get the above error.
~/Code/dart-sdk-2.8.4/bin/pub cache repair
~/Code/dart-sdk-2.8.4/bin/pub get
~/Code/dart-sdk-2.8.4/bin/pub upgrade
~/Code/dart-sdk-2.8.4/bin/pub global activate webdev
~/Code/dart-sdk-2.8.4/bin/pub global run webdev build --verbose --output=web:build -- --delete-conflicting-outputs || exit
This is my pubspec.yaml, not much in there
name: blah
version: 0.0.0
description: Blah
environment:
sdk: ">=2.8.0 <3.0.0"
dev_dependencies:
build_runner: ^1.10.0
build_test: ^0.10.2
build_web_compilers: ^2.11.0
test: ^1.0.0
And I'm on Dart 2.8.4 (getting the same on other versions of Dart, so not sure if the Dart version has an effect)
Any ideas?

Seems like there's a temp workaround
pub global activate webdev 2.5.6
https://github.com/dart-lang/webdev/issues/1036
https://github.com/dart-lang/webdev/issues/1037

Related

Dart Webdev Dev Compiler not running since upgrade to 2.3.2

Since I have moved from Dart 2.1.0 to 2.3.2 "webdev serve" runs successfully, but when I run the project, it gets a 404 on "main.digests". I updated my dev dependencies of build_runner, build_web_compiler, and webdev to the latest versions, and the issue still occurs.
It still builds in dart2js fine. Even if it is "webdev serve --release" it works.
Here is a copy of my pubspec:
environment:
sdk: '>=2.3.2 <3.0.0'
dependencies:
analyzer: any
intl: any
stagexl: 1.4.0+2
stagexl_particle: ^0.4.0
uuid: ^1.0.3
dependency_overrides:
stagexl:
git: https://github.com/AndrewLugg/StageXL.git
dev_dependencies:
build_runner: ^1.6.1
build_web_compilers: ^2.1.1
webdev: ^2.2.0
and here is my build.yaml
targets:
$default:
builders:
build_web_compilers|entrypoint:
generate_for:
- web/app/**.dart
options:
dart2js_args:
- --fast-startup
- --no-source-maps
- --show-package-warnings
- --trust-primitives
- --trust-type-annotations
- --omit-implicit-checks
Here is a copy of the error:
http://localhost:53322/webdev/src/serve/injected/client.js:2693
GET http://localhost:53322/app/main.digests 404 (Not Found)
Uncaught Instance of 'minified:b0' client.js:367
Any help would be greatly appreciated.
This problem disappeared once we upgraded to Dart SDK 2.5.2, there was no real explanation to why this happened.

Json Serialization with Dartson

Following the sample on the Dartson documentation page,
import 'package:dartson/dartson.dart';
import 'package:some_dependency/some_class.dart';
import 'my_class.dart';
#Serializer(
entities: [
MyClass,
SomeClass,
],
)
final Dartson<Map<String, dynamic>> serializer = _serializer$dartson;
I'm getting undefined name _serializer$dartson.useCodec(json) and also wondering where _serializer is referenced from.
Yes, I have added the required dependencies to my pubspec.yaml.
dependencies:
dartson: ^1.0.0-alpha+2
dev_dependencies:
build_runner: ^0.10.0
The required dependency on build_runner indicates that a build step is needed. Depending on how Dartson define's its builders it may be enough to run pub run build_runner build (or for flutter, flutter packages pub run build_runner build.
You might want to file an issue on Dartson to make the build instructions more clear.

Webdev failed with an unexpected exception (Dart SDK 2.0.0-dev.69.1)

I have updated Dart SDK to 2.0.0-dev.69.1 version.
Also, I hace updated my pubspec.yaml file to this:
environment:
sdk: '>=2.0.0-dev.69.1 <2.0.0'
dependencies:
sass_builder: ^2.1.1
angular: ^5.0.0-beta+2
angular_components: ^0.9.0-beta
angular_forms: ^2.0.0-beta+2
angular_router: ^2.0.0-alpha+17
js: ^0.6.1+1
path: ^1.6.2
dev_dependencies:
angular_test: ^2.0.0-beta+2
build_runner: ^0.9.2
build_test: ^0.10.3+1
build_web_compilers: ^0.4.1
test: ^1.3.0
I run the command pub global activate webdev.
⚠ After these steps, I tried to run webdev serve command. I receive this error message:
webdev failed with an unexpected exception.
Unable to spawn isolate: file:///C:/Users/marco/AppData/Roaming/Pub/Cache/hosted/pub.dartlang.org/analyzer-0.32.3/lib/src/dart/analysis/library_context.dart:96:34: Error: Can't return a value from a void function.
return appendLibraryFiles(targetLibrary);
^
❔ Did you also find the same problem? How can I solve this problem?
Thanks!
There is an issue with SDK 2.0.0-dev.69.1 -- see this announcement. I'm not sure if it is related, but you might need to wait for the next release of the SDK, or downgrade to 2.0.0-dev.69.0.

package "dart_to_js_script_rewriter" is not a dependency

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';

Pub build produces warning every build: 'Can't find 'animate' in the library 'angular'.'

I'm boldly stepping into the world of AngularDart, admittedly not knowing too much Dart itself yet. I'm creating a new application that does nothing (yet), except includes the latest 'angular' package.
I'm using Dart 1.2.0 and AngularDart 0.9.9.
Very simple pubspec:
name: myapp
dependencies:
angular: any
My app layout:
pubspec.yaml
pubspec.lock
\lib
\packages
\web
In web I have a simple myapp.dart:
import 'package:angular/angular.dart';
main() {
}
My build seems to work fine, but I get the following warning:
Dart: Build
[Warning from Dart2JS on myapp|web/myapp.dart]:
packages\angular\angular.dart:31:23: Hint: Can't find 'animate' in the library 'angular'.
Is 'animate' spelled right?
#MirrorsUsed(targets: const [
^^^^^^^^
My question is, what does this mean, and is this anything to be concerned about?
This was a bug in AngularDart 0.9.9 and is fixed in current versions.

Resources