webcomponents.js失败,错误404

时间:2014-12-17 05:57:21

标签: dart dart-polymer dart-pub

在运行与webcomponents.js相关的dart应用程序时,我在控制台中看到异常 一切都按预期运行,我应该忽略这个例外吗?

Failed to load resource: the server responded with a status of 404 (Not Found)
  http://localhost:8080/packages/web_components/webcomponents.js

enter image description here

pubspec.yaml:

name: alm
description: alm
dependencies:
  browser: any
  # bootjack: any
  polymer: ">0.15.3"
  paper_elements: any
transformers:
- polymer:
    entry_points:
      - web/index.html

的index.html

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Test</title>
  <!--
  <link rel="stylesheet" href="packages/bootjack/css/bootstrap.min.css">
  -->
  <link rel="import" href="packages/polymer/polymer.html">
  <link rel="import" href="packages/paper_elements/paper_button.html">
  <link rel="import" href="packages/paper_elements/paper_input.html">  
</head>
<body unresolved>
  <script type="application/dart" src="index.dart"></script>

  <div id="more-buttons">
    <paper-button raised class="colored">colored</paper-button>
    <paper-button raised disabled>disabled</paper-button>
  </div>

  <script src="packages/browser/dart.js"></script>
</body>
</html>

index.dart:

import 'dart:html';
import 'package:polymer/polymer.dart';
//import 'package:bootjack/bootjack.dart';
import 'package:paper_elements/paper_button.dart';
import 'package:paper_elements/paper_input.dart';

void main() {

  print("begin");

  initPolymer().run(() {
    Polymer.onReady.then((_) {

      DivElement div = querySelector("#more-buttons");

      div.appendHtml("123");

      PaperButton y = new PaperButton();
      y.text = "KOTS";
      y.raised = true;
      div.append(y);

      PaperInput x = new PaperInput();
      x.value = "KOTS";
      div.append(x);

    });
  });

  print("end");
}

1 个答案:

答案 0 :(得分:2)

Fox32建议我删除我的〜/ .pub文件夹,再做一个pub。 在这样做之后,我一直遇到酒吧内存不足。

Timo D建议我也删除〜/ .pub-cache。 在另一家酒吧和酒吧服务之后,它运行得很好。

谢谢Timo D和Fox32 !!