【问题标题】:dart including libraries with wrong casing in URI飞镖包括 URI 中大小写错误的库
【发布时间】:2013-04-29 15:04:14
【问题描述】:

所以我已经在 Dart 中从事这个项目几个月了,没有太多大问题,直到上周的最新更新似乎打破了我的应用程序中包含库的方式。我有一个名为“BeerRun”的应用程序包,带有标准的 lib/ 和 web/ 目录。在“web”中,我有主 beer_run.dart 文件,该文件包含在 web/BeerRun.html 中并被调用。我已经运行了 pub install 和 pub update,但是当我运行我的 dart 应用程序时,我看到了以下错误:

加载资源失败:服务器响应状态为 404(未找到) http://127.0.0.1:3030/home/kyle/dart/BeerRun/web/packages/beerrun/src/input/keyboard_input_component.dart 加载文件包失败:beerrun/src/input/keyboard_input_component.dart

大约有 20 个此消息实例引用了不同的 dart 源文件。问题是路径应该是/home/kyle/dart/BeerRun/web/packages/BeerRun/src/input,但是浏览器使用所有小写的路径名来包含这个文件。上周这不是问题,直到我升级了我的 Dart 编辑器;现在是 22223 版。有什么我遗漏的吗?

提前致谢!

【问题讨论】:

  • 我怀疑你在 Linux 上?
  • 您能粘贴您的pubspec.yaml 文件吗?我很好奇你的应用叫什么名字。
  • 另外,你能粘贴从你的 web/ 目录运行递归 ls -l 的结果吗?我很好奇符号链接是什么样的。谢谢!
  • 请粘贴一份导入声明的副本,以及项目目录的屏幕截图(打开每个子目录,以便我们可以看到整个目录树)。谢谢!

标签: dart dart-editor dart-pub dartium


【解决方案1】:
Failed to load resource: the server responded with a status of 404 (Not Found)
  http://127.0.0.1:3030/home/axl/workspace/dart/Test/web/packages/test/text.dart

我遇到了同样的问题,解决方法是通过以下方式包含库:

import '../lib/text.dart';

而不是

import 'package:Test/test.dart'

版本信息:Dart Editor/SDK 版本 0.6.19_r26297

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-16
    • 1970-01-01
    • 2020-01-03
    • 2019-06-29
    • 2013-12-27
    相关资源
    最近更新 更多