gpt4 book ai didi

logging - 为什么从Dart Logging_handler包中导入browser_logging_handler失败?

转载 作者:行者123 更新时间:2023-12-03 03:45:46 25 4
gpt4 key购买 nike

这是我的pubspec.yaml文件。我已经经营了两次酒吧。

name: LogTest
description: A sample Polymer application
dependencies:
logging: any
logging_handlers: any
polymer: '>=0.12.0 <0.13.0'
transformers:
- polymer:
entry_points: web/logtest.html

但是,当我尝试运行我的应用程序时。它失败,并显示以下消息:
Failed to load resource: the server responded with a status of 404 (Not Found)   
http://localhost:8081/packages/logging_handlers/browser_logging_handlers.dart An error occurred loading
file: package:logging_handlers/browser_logging_handlers.dart

我的dart文件(logtest.dart):

import 'package:polymer/polymer.dart'as polymer;
import 'package:logging/logging.dart';
import 'package:logging_handlers/browser_logging_handlers.dart';

void main(){
polymer.initPolymer().run((){
polymer.Polymer.onReady.then((_){
// loggie.attachXLoggerUi();
});
});
}

和html文件(logtest.html):

<!DOCTYPE html>

<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample app</title>

<!-- include the web_components polyfills with support for Dart. -->
<script src="packages/web_components/platform.js"></script>
<script src="packages/web_components/dart_support.js"></script>

<!-- import the click-counter -->
<link rel="import" href="clickcounter.html">

<link rel="stylesheet" href="logtest.css">
</head>
<body>
<h1>LogTest</h1>

<p>Hello world from Dart!</p>

<div id="sample_container_id">
<click-counter count="5"></click-counter>
</div>

<!-- bootstrap polymer -->
<script type="application/dart" src="logtest.dart"></script>
<script src="packages/browser/dart.js"></script>
</body>
</html>

最佳答案

好像pub serve无法识别pubspec.yaml文件或packages目录中的附加链接中的更改。 pub serve输出 View 具有一个用于停止pub serve的按钮。下次您启动该应用程序时,pub serve会自动再次启动。

关于logging - 为什么从Dart Logging_handler包中导入browser_logging_handler失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26611901/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com