Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to precompile build_runner:build_runner #3151

Closed
insinfo opened this issue Jul 21, 2021 · 3 comments
Closed

Failed to precompile build_runner:build_runner #3151

insinfo opened this issue Jul 21, 2021 · 3 comments

Comments

@insinfo
Copy link

insinfo commented Jul 21, 2021

On Windows it is compiling normally
is crashing on linux

webdev build
[SEVERE] Failed to precompile build_runner:build_runner:
[SEVERE] /root/.pub-cache/hosted/pub.dartlang.org/analyzer-0.40.6/lib/src/error/best_practices_verifier.dart:258:50: Error: The property 'displayString' is defined in multiple extensions for 'TargetKind' and neither is more specific.
[SEVERE]  - 'TargetKind' is from 'package:meta/meta_meta.dart' ('/root/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart').
[SEVERE] Try using an explicit extension application of the wanted extension or hiding unwanted extensions from scope.
[SEVERE]         var kindNames = kinds.map((kind) => kind.displayString).toList()
[SEVERE]                                                  ^^^^^^^^^^^^^
[SEVERE] /root/.pub-cache/hosted/pub.dartlang.org/analyzer-0.40.6/lib/src/error/best_practices_verifier.dart:1917:14: Context: This is one of the extension members.
[SEVERE]   String get displayString {
[SEVERE]              ^^^^^^^^^^^^^
[SEVERE] /root/.pub-cache/hosted/pub.dartlang.org/meta-1.7.0/lib/meta_meta.dart:91:14: Context: This is one of the extension members.
[SEVERE]   String get displayString {
[SEVERE]              ^^^^^^^^^^^^^
[SEVERE] /root/.pub-cache/hosted/pub.dartlang.org/analyzer-0.40.6/lib/src/error/best_practices_verifier.dart:260:36: Error: The getter 'commaSeparatedWithOr' isn't defined for the class 'List<dynamic>'.
[SEVERE]  - 'List' is from 'dart:core'.
[SEVERE] Try correcting the name to the name of an existing getter, or defining a getter or field named 'commaSeparatedWithOr'.
[SEVERE]         var validKinds = kindNames.commaSeparatedWithOr;
[SEVERE]                                    ^^^^^^^^^^^^^^^^^^^^
Unhandled exception:
Bad state: Unable to start build daemon.
#0      _handleDaemonStartup (package:build_daemon/client.dart:82:5)
<asynchronous suspension>
#1      BuildDaemonClient.connect (package:build_daemon/client.dart:183:5)
<asynchronous suspension>
#2      BuildCommand.run (package:webdev/src/command/build_command.dart:59:20)
<asynchronous suspension>
#3      CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#4      _CommandRunner.runCommand (package:webdev/src/webdev_command_runner.dart:40:12)
<asynchronous suspension>
#5      main (file:///root/.pub-cache/hosted/pub.dartlang.org/webdev-2.7.2/bin/webdev.dart:19:16)
<asynchronous suspension>
  • Dart SDK Version 2.12.4
  • Whether you are using Linux
  • Whether you are using Chrome

pubspec.yaml

name: cmpop_browser
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com

environment:
  sdk: ">=2.7.1 <3.0.0"

dependencies:
  angular: ^6.0.0
  angular_components: ^1.0.2
  angular_router: ^2.0.0
  angular_forms: ^3.0.0
  sembast_web: ^1.2.0
  angular_recaptcha: ^0.1.5
  stream_transform: #^0.0.19
  sass_builder: ^2.1.3
  intl: ^0.16.1
  uuid: ^2.2.2
  crossplat_objectid: ^2.1.4  
  http: ^0.12.2
  quiver: ^2.1.5

 

dev_dependencies: 
  angular_test: ^3.0.0                                                                                                 
  build_runner: ^1.10.4                                                                                                   
  build_test: ^1.3.0                                                                                              
  build_web_compilers: ^2.12.0                                                                                
  pedantic: ^1.9.2                                                                                               
  test: ^1.15.4
@rhbrunetto
Copy link

rhbrunetto commented Jul 22, 2021

Had this same issue on Flutter this morning.

Turns out my Flutter was on 2.4.0-5.0.pre (Dart 2.14.0) and downgrading it to 2.2.3 (that uses Dart 2.13.4) solved this issue.

@jakemac53
Copy link
Contributor

The workaround for this is to upgrade analyzer if possible, and otherwise pin meta to an older version, I think <1.7.0.

@jakemac53
Copy link
Contributor

See dart-lang/sdk#46687 also, I am going to close this as a duplicate of that as its a more general issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants