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
Use dart2js --enable-enum
when "Enable Enums" preference is selected
#21823
Comments
cc @danrubel. |
This comment was originally written by @zoechi As far as I know this can only be set using the transformers section in pubspec.yaml like transformers:
but is this really necessary? |
It's very much needed. Thanks for the magic code! I'd forgotten about being able to configure dart2js options in pub. Here's what I used: transformers:
(It's --enable-enum, singular, btw.) When I don't use the command-line option, I get this error message: web/main.dart:10:1: [web] GET /main.dart.js => Could not find asset web_async_enum|web/main.dart.js.Use option '--enable-enum' to use enum declarations. enum Color { |
This comment was originally written by @zoechi As far as I know the $dart2js transformer needs to be the last transformer. There should be an open issue to cope with this more gracefully if it is not the case but I couldn't find the issue. |
Oh, strange. Thanks for that intel, gzoechi. I originally had it last, but Dart Editor complained until I moved it first. (DE was probably just having a bad moment; it seems to be working now that I move it to last place. I'll follow up with the pub engineers about this.) |
It looks like the order doesn't matter any more: https://code.google.com/p/dart/source/detail?r=42072 |
We expect dart2js to default to enabling enums https://code.google.com/p/dart/issues/detail?id=21885 so perhaps we can close this? |
dart2js already accepts enums by default. This can be closed now. |
Added AssumedStale label. |
Added this to the 1.9 milestone. |
If you're using enums in your web app, then obviously you want to use the --enable-enum option when compiling to JavaScript.
Hopefully that's an easy fix. In the meantime, what's the workaround?
(I couldn't figure out how to specify dart2js options from the Manage Launches dialog. I deleted all my launches and launched the app from the index.html file. When I opened Run > Manage Launches again, I didn't see any command-line options—just HTML/URL paths you could specify.)
The text was updated successfully, but these errors were encountered: