问题
I'm seeing exceptions in my console when running my dart app related to webcomponents.js Everything is running as expected, should I ignore this exception?
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8080/packages/web_components/webcomponents.js
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:
Fox32 suggested that I delete my ~/.pub folder and do a pub get again. After doing that, I ran into pub running out of memory the whole time.
Timo D suggested I also delete ~/.pub-cache which I did. After another pub get and pub serve, it's running perfectly.
Thanks Timo D and Fox32 !!
来源:https://stackoverflow.com/questions/27519217/webcomponents-js-fails-with-error-404