Skip to content

pub build / pub serve fails on 2.0.0-dev.39 #32561

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

Closed
cedx opened this issue Mar 16, 2018 · 4 comments
Closed

pub build / pub serve fails on 2.0.0-dev.39 #32561

cedx opened this issue Mar 16, 2018 · 4 comments
Assignees

Comments

@cedx
Copy link

cedx commented Mar 16, 2018

If I build or serve my app using the --use-old-frontend flag of dart2js (via the pub transformers in the pubspec.yaml file), everything is OK.
If I remove the --use-old-frontend flag, a lot of errors raise from the charcode package (probably an indirect dependency of my app):

[...]
[Error from Dart2JS on pms_isol|web/js/main.dart]:
web/packages/charcode/html_entity.dart:621:1:
The control character U+0000 can only be used in strings and comments.
/// for all ('∀')
^
[Error from Dart2JS on pms_isol|web/js/main.dart]:
web/packages/charcode/html_entity.dart:630:1:
The control character U+0000 can only be used in strings and comments.
/// empty set (null set); see also U+8960, ⌀ ('∅')
^
[Error from Dart2JS on pms_isol|web/js/main.dart]:
web/packages/charcode/html_entity.dart:744:35:
String starting with ' must end with '.
/// left floor (APL downstile) ('⌊')
                                  ^
[Error from Dart2JS on pms_isol|web/js/main.dart]:
web/packages/charcode/html_entity.dart:621:17:
Expected a declaration, but got ')'.
/// for all ('∀')
                ^
[Error from Dart2JS on pms_isol|web/js/main.dart]:
web/packages/charcode/html_entity.dart:630:46:
Expected a declaration, but got '('.
/// empty set (null set); see also U+8960, ⌀ ('∅')
                                             ^
[Error from Dart2JS on pms_isol|web/js/main.dart]:
web/packages/charcode/html_entity.dart:630:47:
Expected a declaration, but got ''''.
/// empty set (null set); see also U+8960, ⌀ ('∅')
[...]
@sigmundch
Copy link
Member

Thanks for filing this bug!

I was able to reproduce this locally as well.

I need to investigate in more detail, but there is something odd about how the pub/dart2js integration is working here, as file contents are not encoded/decoded correctly between the two. If I take the same project files and compile with dart2js on the command-line, then there is no issue.

I'll keep looking and report again soon.

/cc @nex3 in case this rings any bells from your understanding of the integration with barback

@sigmundch sigmundch self-assigned this Mar 16, 2018
@nex3
Copy link
Member

nex3 commented Mar 16, 2018

Not ringing any bells, no...

@sigmundch
Copy link
Member

Good news - I found the cause behind this. Fix is out for review (https://dart-review.googlesource.com/c/sdk/+/46945).

The new front-end reads files in binary form, while the old one read them as Strings. Both were requesting them as Strings from pub, but we re-encoded strings incorrectly using code units instead of utf8. That codepath was basically never used before.

The fix is to do the correct translation. However, I may follow up with a change in pub to skip using strings entirely to avoid the double conversion in the first place.

@sigmundch
Copy link
Member

I landed a fix, which should become available on the next dev release.

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

No branches or pull requests

3 participants