-
Notifications
You must be signed in to change notification settings - Fork 229
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
Pub build fails if project has been "Run as JavaScript" #704
Comments
<img src="https://avatars.githubusercontent.com/u/2108507?v=3" align="left" width="48" height="48"hspace="10"> Comment by dgrove cc @sigmundch. |
<img src="https://avatars.githubusercontent.com/u/2049220?v=3" align="left" width="48" height="48"hspace="10"> Comment by sigmundch Thanks Matt for the error report! Seems like this is exactly the kind of conflicts mentioned in issue dart-archive/barback#18. Bob/Nathan - I'm not marking this yet as a duplicate with that issue because this might be a very common scenario and we might don't want to nag users with an error message all the time. Some alternatives could be: Thoughts? cc @nex3. |
<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3 I'm not a big fan of adding extra logic to silently ignore this case. We don't really have a good way of knowing whether it's okay to overwrite the existing JS file when running "pub build", and we don't want to silently do it if it's not okay. I think the ideal final state here is for the editor to do all its compilation stuff through pub/barback. That's a ways away at the moment, though. |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent We should definitely do something better here in the short term. Once #14554 is fixed, we could workaround this by having the dart2js transformer in pub try to read the existing .dart.js file as a secondary input. (Although getting that to gracefully handle the JS file not existing will be tricky.) |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent Issue dart-lang/sdk#15664 has been merged into this issue. |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent Issue dart-lang/sdk#15823 has been merged into this issue. |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent Added Started label. |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent Removed Priority-Unassigned label. |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent Set owner to @munificent. |
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd Thanks! What's the resolution? That is, how was it fixed? |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent The problem is that barback will rightfully complain if it sees a file collision: if two transformers try to generate a file with the same path, or if a transformer generates a file that collides with a source file already on disk. In this case, it's the latter. There's already a foo.dart.js file on disk, so when the dart2js transformer tries to create that too, pub raises an error. The solution is pretty simple. In pub build, if we see a file in your package named ".dart.js", we assume it was created by dart2js and just pretend it doesn't exist since pub's own dart2js transformer will be creating it. |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent Issue #819 has been merged into this issue. |
This comment was originally written by [email protected] I was running into this tonight, after seeing this issue I checked for an update, updated, and the issue was resolved. Thank you! |
<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent Woo-hoo! \o/ |
<img src="https://avatars.githubusercontent.com/u/1148886?v=3" align="left" width="96" height="96"hspace="10"> Issue by butlermatt
Originally opened as dart-lang/sdk#14771
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Expect that the project is built into the build/ directory. Instead it fails with an error:
"Transforms {Dart2JS on myproject|web/myproject.dart} all emitted asset myproject|web/myproject.dart.js."
It appears pub build does't know how to deal with already built javascript files.
What version of the product are you using? On what operating system?
Ubuntu 13.10 64-bit
Dart Editor version 0.8.7_r29341 (64-bit)
Dart SDK version 0.8.7.0_r29341
Please provide any additional information below.
Deleting the javascript files (.dart.js, .dart.precompiled.js, .dart.js.map, .dart.js.deps) and running pub build works correctly.
The text was updated successfully, but these errors were encountered: