运行pub serve
后,我收到了一条不寻常的错误消息:
Loading source assets...
Loading polymer, angular2 and dart_to_js_script_rewriter transformers...
Serving group_maker web on http://localhost:8080
Build error:
Transform WebComponents on group_maker|web/index.html threw error:
Invalid argument(s): Illegal character in path
dart:core/uri.dart 861 Uri._checkWindowsPathReservedCharacters
dart:core/uri.dart 962 Uri._makeWindowsFileUrl
dart:core/uri.dart 744 Uri.Uri.file
package:analyzer/src/string_source.dart 30 StringSource.StringSource
package:dart_style/src/dart_formatter.dart 81 DartFormatter.formatSource
package:dart_style/src/dart_formatter.dart 62 DartFormatter.format
package:initialize/transformer.dart 340 _BootstrapFileBuilder._buildNewEntryPoint
package:initialize/transformer.dart 225 _BootstrapFileBuilder.run
package:initialize/transformer.dart 37 generateBootstrapFile
package:web_components/build/web_components.dart 32 generateWebComponentsBootstrap
package:web_components/build/web_components.dart 82 WebComponentsTransformer.apply.<fn>.<fn>
dart:async/zone.dart 1204 _RootZone.runUnary
dart:async/future_impl.dart 131 _FutureListener.handleValue
dart:async/future_impl.dart 637 _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 667 _Future._propagateToListeners
dart:async/future_impl.dart 477 _Future._completeWithValue
dart:async/future_impl.dart 528 _Future._asyncComplete.<fn>
dart:async/schedule_microtask.dart 41 _microtaskLoop
dart:async/schedule_microtask.dart 50 _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 96 _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 149 _RawReceivePortImpl._handleMessage
dart:core Uri.Uri.file
package:analyzer/src/string_source.dart 30 StringSource.StringSource
package:dart_style/src/dart_formatter.dart 81 DartFormatter.formatSource
package:dart_style/src/dart_formatter.dart 62 DartFormatter.format
package:initialize/transformer.dart 340 _BootstrapFileBuilder._buildNewEntryPoint
package:initialize/transformer.dart 225 _BootstrapFileBuilder.run
package:initialize/transformer.dart 37 generateBootstrapFile
package:web_components/build/web_components.dart 32 generateWebComponentsBootstrap
package:web_components/build/web_components.dart 82 WebComponentsTransformer.apply.<fn>.<fn>
Build completed with 1 errors.
供参考,以下是我的index.html
和main.dart
个文件:
index.html
:
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Group Maker</title>
<base href="/">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
<link href="styles.css" rel="stylesheet">
<meta name="coverage" content="Worldwide">
<meta name="google" content="nositelinkssearchbox">
<meta name="googlebot" content="index,follow">
<meta name="msapplication-TileColor" content="#FFFFFF">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="rating" content="General">
<meta name="theme-color" content="#ffffff">
<link href="icons/apple-icon-57x57.png" rel="apple-touch-icon" sizes="57x57">
<link href="icons/apple-icon-60x60.png" rel="apple-touch-icon" sizes="60x60">
<link href="icons/apple-icon-72x72.png" rel="apple-touch-icon" sizes="72x72">
<link href="icons/apple-icon-76x76.png" rel="apple-touch-icon" sizes="76x76">
<link href="icons/apple-icon-114x114.png" rel="apple-touch-icon" sizes="114x114">
<link href="icons/apple-icon-120x120.png" rel="apple-touch-icon" sizes="120x120">
<link href="icons/apple-icon-144x144.png" rel="apple-touch-icon" sizes="144x144">
<link href="icons/apple-icon-152x152.png" rel="apple-touch-icon" sizes="152x152">
<link href="icons/apple-icon-180x180.png" rel="apple-touch-icon" sizes="180x180">
<link href="icons/android-icon-192x192.png" rel="icon" type="image/png" sizes="192x192">
<link href="icons/favicon-32x32.png" rel="icon" type="image/png" sizes="32x32">
<link href="icons/favicon-96x96.png" rel="icon" type="image/png" sizes="96x96">
<link href="icons/favicon-16x16.png" rel="icon" type="image/png" sizes="16x16">
<link rel="manifest" href="icons/manifest.json">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="https://code.jquery.com/jquery-3.0.0.min.js" integrity="sha256-JmvOoLtYsmqlsWxa7mDSLMwa6dZ9rrIdtrrVYRnDRH0=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/js/bootstrap.min.js" integrity="sha384-vZ2WRJMwsjRMW/8U7i6PWi6AlO1L79snBrmgiDpgIWJ82z8eA5lenwvxbMV1PAh7" crossorigin="anonymous"></script>
<script defer src="main.dart" type="application/dart"></script>
<script async src="packages/browser/dart.js"></script>
</head>
<body unresolved>
<h1>Hello, world!</h1>
</body>
</html>
main.dart
:
import 'package:angular2/platform/browser.dart';
import 'package:polymer/polymer.dart';
main() async {
await initPolymer();
}
任何人都能做出正面或反面吗?