dart_to_js_script_rewriter
dart_to_js_script_rewriter copied to clipboard
" zero or multiple dart scripts" error
Even though I have reference to a single dart script, I get the following error on "release" build.
[Error from ScriptCompactor on Project|web/index.html]:
Found either zero or multiple dart scripts in the entry point `web/index.html`. Exactly one was expected.
I do have references to two other JavaScript scripts in the same index.html.
I am not sure if I am doing something wrong, or this is a bug.
I may be mistaken, but I think ScriptCompactor is actually part of the DartSDK. This is an SDK bug, not dart_to_js_script_rewriter bug.
Can you please post your pubspec.yaml ?
Thanks, Faisal and Seth.
Here is my pubspec.yaml:
name: Project
version: 0.0.1
author: <Hesh> <[email protected]>
description: Check those boxes
homepage: http://proteme.org/Anton
environment:
sdk: '>=1.0.0 <2.0.0'
dependencies:
browser: any
core_elements: any
firebase: any
intl: any
js_bridge: any
paper_elements: any
polymer: any
string_tokenizer: any
uuid: any
test: any
dart_to_js_script_rewriter: any
transformers:
- dart_to_js_script_rewriter
- polymer:
entry_points:
- web/index.html
- web/rules.html
- $dart2js:
commandLineOptions: [--enable-experimental-mirrors]
I also tried with removing one of the entry points, but with same results.
I see the same error in a polymer 1.0 application if I put dart_to_js_script_rewritter
as the first transformer. Putting it after web_components
makes it so the error doesn't appear but then the transformer doesn't seem to be doing its job as both script tags are still there.
ah, the issue here is the dart_to_js_script_rewriter
transformer should come after the polymer transformer. The ScriptCompactor
is one of the Polymer phases, it looks in your entry point html for dart script tags and html imports, and bootstraps the app with a single dart file that imports all reachable dart files.