Issue
I have an AngularDart-based web project. When I’m try webdev serve
, I get this:
[SEVERE] Support for dartdevc in build_web_compilers < 2.0.0 has been removed.
Please upgrade your dependency to:
dev_dependencies:
build_web_compilers: ">=2.0.0"
[SEVERE] Exception: dartdevc is no longer supported by this version
However, I already have the dependency set to “2.0.0 and newer”. Here is my pubspec.yaml
file:
name: myproject
description: My Description
environment:
sdk: '>=2.3.3 <3.0.0'
dependencies:
angular: ^5.2.0
angular_components: ^0.13.0
dev_dependencies:
angular_test: ^2.2.0
build_runner: ^1.5.0
build_test: ^0.10.3
build_web_compilers: ^2.0.0
pedantic: ^1.0.0
test: ^1.5.1
I tried pub get
, pub upgrade
, pub activate global webdev
, even pub cache repair
.
In general, I seem to have problems with dependencies when creating AngularDart projects, even when I use versions from the Dart docs. Is there a magic way to know exactly which version numbers to use?
Solution
Try deleting your .dart_tool
directory, rerun pub get
and try again.
That directory is where dart stores all of the dependencies and artifacts of the build process. Sometimes it can get in an odd state.
Whenever your Dart build is misbehaving in ways that defy explanation, it is good practice to delete the .dart_tool
directory first and build clean to see if that fixes it.
Answered By – Brian Gorman
Answer Checked By – Katrina (FlutterFixes Volunteer)