Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

" zero or multiple dart scripts" error #18

Open
proteme opened this issue Sep 27, 2015 · 5 comments
Open

" zero or multiple dart scripts" error #18

proteme opened this issue Sep 27, 2015 · 5 comments

Comments

@proteme
Copy link

proteme commented Sep 27, 2015

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.

@FaisalAbid
Copy link

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.

@sethladd
Copy link
Contributor

Can you please post your pubspec.yaml ?

@proteme
Copy link
Author

proteme commented Sep 28, 2015

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.

@donny-dont
Copy link

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.

@jakemac53
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants