dart-archive / custom-element-apigen

Tool to generate Dart APIs for polymer custom elements written in Javascript
BSD 3-Clause "New" or "Revised" License
13 stars 13 forks source link

Build error: Transforms Dart2JS on all emitted asset #45

Closed Hecatoncheir closed 8 years ago

Hecatoncheir commented 8 years ago

Dart VM version: 1.14.2 (Tue Feb 9 15:09:45 2016) on "linux_x64" Pub 1.14.2

Hi. When I try run pub serve of generated polymer element, I get error:

Build error:
Transforms {Dart2JS on wysiwyg_e|example/packages/test/src/runner/browser/static/host.dart} all emitted asset wysiwyg_e|example/packages/test/src/runner/browser/static/host.dart.js.

Yaml for custom-element-apigen:

files_to_generate:
    - wysiwyg-e/wysiwyg-e.html
    - iron-flex-layout/iron-flex-layout.html
    - iron-flex-layout/iron-flex-layout-classes.html
    - iron-icon/iron-icon.html
    - iron-icons/iron-icons.html
    - iron-media-query/iron-media-query.html
    - font-roboto/roboto.html
    - paper-button/paper-button.html
    - paper-item/paper-item.html
    - paper-listbox/paper-listbox.html
    - paper-menu-button/paper-menu-button.html
    - iron-behaviors/iron-control-state.html
    - paper-behaviors/paper-ripple-behavior.html
files_to_load:
    - lib/src/undo-mgr/behavior.html
    - lib/src/paper-behaviors/paper-button-behavior.html
    - lib/src/paper-item/paper-item-behavior.html
    - lib/src/iron-behaviors/iron-button-state.html
    - lib/src/iron-menu-behavior/iron-menu-behavior.html
    - lib/src/iron-selector/iron-multi-selectable.html
    - lib/src/iron-selector/iron-selectable.html
    - lib/src/iron-a11y-keys-behavior/iron-a11y-keys-behavior.html

StackOverflow Repository with generated element

jakemac53 commented 8 years ago

Something weird is going on here, pub seems to think that the file example/packages/test/src/runner/browser/static/host.dart is part of the wysiwyg_e package, which it is not.

Hecatoncheir commented 8 years ago

How can I fix this?

jakemac53 commented 8 years ago

cc @nex3 do you have any idea what would cause this?

nex3 commented 8 years ago

This error usually means that there's a copy of the given file on the filesystem and a transformer is trying to generate one, which produces a conflict.

jakemac53 commented 8 years ago

This asset id doesn't seem to make any sense either tho wysiwyg_e|example/packages/test/src/runner/browser/static/host.dart, my guess would be that lies at the root of the issue?

nex3 commented 8 years ago

Yeah, that is strange. Transformers shouldn't ever be running on a file in /packages/.

Hecatoncheir commented 8 years ago

it's important to me. I meet with this error with every element that I want to do port.

jakemac53 commented 8 years ago

I noticed you have checked in a .packages file as well as the packages symlink in the example folder. These should both be added to your .gitignore, not sure if it might be affecting things or not.

jakemac53 commented 8 years ago

I sent out https://github.com/Rasarts/wysiwyg-e/pull/1 which cleans up things to use the stubs_to_generate and package_mappings options. I was not seeing the reported issue though.

Hecatoncheir commented 8 years ago

Thanks for pr. The error can be seen at terminal, when localhost open in Dartium.

jakemac53 commented 8 years ago

Yes I checked there, everything is working fine for me (although i do get some runtime errors). I would recommend cloning the repo in a new folder and trying to start over? Or possibly running pub cache repair and deleting your .pub directory.

Hecatoncheir commented 8 years ago

Yes, thanks. Now work without error.