简体   繁体   English

Tracing.dart的Angular Dart导入错误

[英]Angular Dart Import Error With Tracing.dart

I am using Angular Dart for a project. 我正在为项目使用Angular Dart。 In my pubspec.yaml I have 在我的pubspec.yaml中

dependencies:
  browser: any
  angular: "^1.1.2+2"
  shadow_dom: any
  json_object: any   
  bootjack: any
  crypto: any
  xml: "^2.3.2"
transformers:
- angular

for my dependencies. 对于我的依赖。 When I run my program in Dartium I get the error 在Dartium中运行程序时,出现错误

The requested built-in library is not available on Dartium.'package:angular/tracing.dart': error: line 9 pos 1: library handler failed
import "dart:developer";
^: package:angular/tracing.dart

I never reference or use anything out of the tracing.dart so I'm not sure why this is causing an error. 我从不引用或使用tracing.dart中的任何内容,因此我不确定为什么会导致错误。

The tracing package is directly using dart:profiler , which was deprecated and now removed. 跟踪包直接使用dart:profiler ,已弃用,现在将其删除。 You can now use dart:developer instead, both libraries are compatible. 现在,您可以改用dart:developer ,这两个库都兼容。

I would suggest to fork the package, replace dart:profiler with dart:developer (no other changes are required) and send a pull request. 我建议分叉该软件包,将dart:profiler替换为dart:developer (不需要其他更改)并发送请求请求。 I already forked and fixed the package some time ago here , but I think the original package is inactive so I didn't created an PR. 我已经在这里分叉并修复了该软件包,但是我认为原始软件包无效,因此我没有创建PR。 You can use my fork by adding this to your pubspec.yaml: 您可以通过将其添加到pubspec.yaml中来使用我的fork:

dependency_overrides:
  tracing:
    git: https://github.com/Fox32/tracing.dart.git

dart:profiler was recently renamed to dart:developer . dart:profiler最近更名为dart:developer One of your dependencies probably use an analyzer version that doesn't fit to your Dart version. 您的依赖项之一可能使用的分析器版本与Dart版本不匹配。

See also https://github.com/dart-lang/pub/issues/1345 另请参阅https://github.com/dart-lang/pub/issues/1345

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Dart 错误:错误:导入 dart:当前 Dart 运行时不支持镜像 - Dart Error: error: import of dart:mirrors is not supported in the current Dart runtime 错误:未找到:“dart:html”导入“dart:html”; - Error: Not found: 'dart:html' import 'dart:html'; 错误:未找到:'dart:js' import 'dart:js'; - Error: Not found: 'dart:js' import 'dart:js'; Dart错误:错误:使用--enable-mirrors = false导入dart:mirrors - Dart Error: error: import of dart:mirrors with --enable-mirrors=false Flutter“错误:未找到:'dart:html'导入'dart:html';” - Flutter "Error: Not found: 'dart:html' import 'dart:html';" 错误:dart 的导入:Flutter 中的当前 Dart 运行时不支持镜像 - error: import of dart:mirrors is not supported in the current Dart runtime in Flutter dart#在Dart编辑器中导入怪异 - dart #import weirdness in dart editor lib/Pages/ChattingPage.dart:15:8: 错误: 未找到: 'dart:html' import 'dart:html' as html; - lib/Pages/ChattingPage.dart:15:8: Error: Not found: 'dart:html' import 'dart:html' as html; Flutter“导入框架:dart”抛出错误 - Flutter “import framework:dart” throws error Dart 错误:错误:导入 dart:当前 Dart 运行时不支持镜像 - Dart Error: error: import of dart:mirrors is not supported in the current Dart runtime using flutter 2.0.2
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM