Ошибка загрузки трансформатора
РЕШЕНИЕ
Так что на самом деле возникли две проблемы, с которыми я столкнулся при создании приложения. Первой была ошибка трансформатора. Однако в комментариях к этому сообщению показано, как исправить эту ошибку (удалите.pub-cache в домашнем каталоге, удалите.pub в каталоге проекта, а затем запустите pub get и восстановление кеша pub).
Однако вторая проблема, с которой я столкнулся, заключалась в том, что у ножниц есть несколько внешних зависимостей, о которых я забыл. Когда я отформатировал свой компьютер, эти зависимости были удалены. После того, как я установил их, я смог построить проект снова.
ОРИГИНАЛЬНЫЙ ВОПРОС
В настоящее время я сталкиваюсь с проблемой при запуске pub build --mode=debug --verbose
где трансформатор angular2 не загружается.
Я отформатировал свою машину прошлой ночью и переустановил все. Сборка работала нормально до того, как я отформатировал, однако сейчас она терпит неудачу. Поэтому я понятия не имею, что может быть причиной этого.
Я попытался удалить.pub-cache и вытащить обратно зависимости. Я тоже пробовал бегать pub cache rebuild --verbose
и ничто не кажется неправильным / необычным. Я не уверен, что мне не хватает.
Ниже приведен полный вывод вышеприведенной команды.
FINE: Pub 1.21.0
IO : Deleting directory build.
FINE: Loading asset environment...
FINE: Initializing barback...
FINE: Serving packages on localhost:0.
MSG : Loading source assets...
FINE: Providing sources for test_project|lib.
FINE: Loading source assets finished (0.060s).
FINE: Provided sources.
FINE: Loading transformers...
FINE: Transformer dependencies:
| scissors: -
| angular2: -
| dart_to_js_script_rewriter: -
| chrome: -
FINE: Using cached transformer snapshot.
MSG : Loading scissors, angular2, dart_to_js_script_rewriter and chrome transformers...
FINE: Loading transformers from [scissors, angular2, dart_to_js_script_rewriter, chrome]
FINE: Spawning isolate from ./.pub/transformers/transformers.snapshot.
FINE: Loading scissors, angular2, dart_to_js_script_rewriter and chrome transformers finished (0.109s).
FINE: Transformers from scissors: {group of [[SassC]]}
ERR : Error on line 18, column 5 of pubspec.yaml: Error loading transformer: Couldn't find library at package:angular2/transformer.dart.
| platform_directives:
| ^^^^^^^^^^^^^^^^^^^^^
FINE: Exception type: TransformerLoadError
FINE: package:pub/src/barback/transformer_isolate.dart 126 TransformerIsolate.create.<async>
| ===== asynchronous gap ===========================
| dart:async _Completer.completeError
| package:pub/src/barback/transformer_isolate.dart 129 TransformerIsolate.create.<async>
| ===== asynchronous gap ===========================
| dart:async _asyncErrorWrapperHelper
| package:pub/src/barback/transformer_isolate.dart TransformerIsolate.create
| package:pub/src/barback/transformer_loader.dart 72 TransformerLoader.transformersFor.<async>
| ===== asynchronous gap ===========================
| dart:async Future.Future.microtask
| package:pub/src/barback/transformer_loader.dart TransformerLoader.transformersFor
| dart:async Future.wait
| package:pub/src/utils.dart 108 waitAndPrintErrors
| package:pub/src/barback/transformer_loader.dart 118 TransformerLoader.transformersForPhases.<async>.<fn>.<async>
| ===== asynchronous gap ===========================
| dart:async Future.wait
| package:pub/src/barback/transformer_loader.dart 117 TransformerLoader.transformersForPhases.<async>
| ===== asynchronous gap ===========================
| dart:async Future.Future.microtask
| package:pub/src/barback/transformer_loader.dart TransformerLoader.transformersForPhases
| package:pub/src/barback/load_all_transformers.dart 92 loadAllTransformers.<async>.<fn>.<async>
| ===== asynchronous gap ===========================
| dart:async Future.wait
| package:pub/src/barback/load_all_transformers.dart 90 loadAllTransformers.<async>
| dart:async _SyncCompleter.complete
| package:pub/src/barback/transformer_loader.dart 61 TransformerLoader.load.<async>
| dart:async _SyncCompleter.complete
| package:pub/src/barback/transformer_isolate.dart 81 TransformerIsolate.spawn.<async>
| ===== asynchronous gap ===========================
| dart:async _asyncThenWrapperHelper
| package:pub/src/barback/load_all_transformers.dart loadAllTransformers
| package:pub/src/barback/asset_environment.dart 503 AssetEnvironment._load.<fn>.<async>.<fn>.<async>.<fn>.<async>
| ===== asynchronous gap ===========================
| package:pub AssetEnvironment._load.<fn>.<async>.<fn>.<async>.<fn>
| package:pub/src/log.dart 408 progress
| package:pub/src/barback/asset_environment.dart 502 AssetEnvironment._load.<fn>.<async>.<fn>.<async>
| ===== asynchronous gap ===========================
| dart:async Future.Future.sync
| package:pub/src/barback/asset_environment.dart 662 AssetEnvironment._withStreamErrors
| package:pub/src/barback/asset_environment.dart 501 AssetEnvironment._load.<fn>.<async>
| dart:async _SyncCompleter.complete
| package:pub/src/barback/asset_environment.dart 663 AssetEnvironment._withStreamErrors.<fn>
| dart:async _SyncCompleter.complete
| package:pub/src/barback/asset_environment.dart 522 AssetEnvironment._provideSources.<async>
| dart:async _SyncCompleter.complete
| package:pub/src/barback/asset_environment.dart 521 AssetEnvironment._provideSources.<async>.<fn>.<async>
| ===== asynchronous gap ===========================
| dart:async _asyncThenWrapperHelper
| package:pub/src/barback/asset_environment.dart AssetEnvironment._load.<fn>
| package:pub/src/log.dart 408 progress
| package:pub/src/barback/asset_environment.dart 450 AssetEnvironment._load
| package:pub/src/barback/asset_environment.dart 82 AssetEnvironment.create.<fn>.<async>
| ===== asynchronous gap ===========================
| dart:async Future.Future.microtask
| package:pub/src/barback/asset_environment.dart AssetEnvironment.create.<fn>
| package:pub/src/log.dart 408 progress
| package:pub/src/barback/asset_environment.dart 74 AssetEnvironment.create
| package:pub/src/command/build.dart 65 BuildCommand.onRunTransformerCommand.<async>
| ===== asynchronous gap ===========================
| dart:async Future.Future.microtask
| package:pub/src/command/build.dart BuildCommand.onRunTransformerCommand
| package:pub/src/command/barback.dart 56 BarbackCommand.run
| package:args/command_runner.dart 177 CommandRunner.runCommand.<fn>
| dart:async Future.Future.sync
| package:args/command_runner.dart 130 CommandRunner.runCommand
| package:pub/src/command_runner.dart 128 PubCommandRunner.runCommand.<async>.<fn>
| dart:async Future.Future.sync
| package:pub/src/utils.dart 72 captureErrors.<fn>
| package:stack_trace Chain.capture
| package:pub/src/utils.dart 86 captureErrors
| package:pub/src/command_runner.dart 128 PubCommandRunner.runCommand.<async>
| dart:async _SyncCompleter.complete
| package:pub/src/command_runner.dart 214 PubCommandRunner._validatePlatform.<async>
FINE: Wrapped exception: Couldn't find library at package:angular2/transformer.dart.
| package:$pub/transformer_isolate.dart 86 _initialize
| package:$pub/transformer_isolate.dart 28 loadTransformers.<fn>.<fn>
| package:$pub/serialize.dart 159 respond.<fn>
| dart:async/future.dart 168 Future.Future.sync
| package:$pub/serialize.dart 159 respond
| package:$pub/transformer_isolate.dart 25 loadTransformers.<fn>
| dart:async/zone.dart 1338 _RootZone.runUnaryGuarded
| dart:async/stream_impl.dart 331 _BufferingStreamSubscription._sendData
| dart:async/stream_impl.dart 258 _BufferingStreamSubscription._add
| dart:async/stream_controller.dart 768 _StreamController&&_SyncStreamControllerDispatch._sendData
| dart:async/stream_controller.dart 635 _StreamController._add
| dart:async/stream_controller.dart 581 _StreamController.add
| dart:isolate-patch/isolate_patch.dart 148 _RawReceivePortImpl._handleMessage
|
| package:$pub/transformer_isolate.dart 86 _initialize
| package:$pub/transformer_isolate.dart 28 loadTransformers.<fn>.<fn>
| package:$pub/serialize.dart 159 respond.<fn>
| dart:async/future.dart 168 Future.Future.sync
| package:$pub/serialize.dart 159 respond
| package:$pub/transformer_isolate.dart 25 loadTransformers.<fn>
| dart:async/zone.dart 1338 _RootZone.runUnaryGuarded
| dart:async/stream_impl.dart 331 _BufferingStreamSubscription._sendData
| dart:async/stream_impl.dart 258 _BufferingStreamSubscription._add
| dart:async/stream_controller.dart 768 _StreamController&&_SyncStreamControllerDispatch._sendData
| dart:async/stream_controller.dart 635 _StreamController._add
| dart:async/stream_controller.dart 581 _StreamController.add
| dart:isolate-patch/isolate_patch.dart 148 _RawReceivePortImpl._handleMessage
FINE: Transformers from dart_to_js_script_rewriter: {DartToJsScriptRewriter}
FINE: Transformers from chrome: {Chrome}
FINE: Loading transformers finished (0.673s).
FINE: Initializing barback finished (0.785s).
FINE: Loading asset environment finished (0.974s).
Вот pubspec.yaml
name: temp_project
description: A Dart app that uses Angular 2
version: 0.0.1
environment:
sdk: '>=1.19.0 <2.0.0'
dependencies:
angular2: any
chrome: any
http: any
dev_dependencies:
scissors: ^0.6.6
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- scissors:
verbose: true
- angular2:
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
entry_points: web/main.dart
resolved_identifiers:
BrowserClient: 'package:http/browser_client.dart'
- dart_to_js_script_rewriter
- chrome