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

Build errors in dart with beta8 #7395

Closed
jrote1 opened this issue Mar 3, 2016 · 25 comments
Closed

Build errors in dart with beta8 #7395

jrote1 opened this issue Mar 3, 2016 · 25 comments
Assignees

Comments

@jrote1
Copy link

jrote1 commented Mar 3, 2016

When building I get the following errors (this is just a snippet as there are to many):


Error in lib/web_worker/PaxHeader/worker.dart and parts: Expected a method, getter, setter or operator declaration

Error in lib/web_worker/PaxHeader/worker.dart and parts: Unexpected token '='

Error in lib/web_worker/PaxHeader/worker.dart and parts: Expected a method, getter, setter or operator declaration

Error in lib/web_worker/PaxHeader/worker.dart and parts: Expected a method, getter, setter or operator declaration

Error in lib/web_worker/PaxHeader/worker.dart and parts: Unexpected token '='

Error in lib/web_worker/PaxHeader/worker.dart and parts: Expected a method, getter, setter or operator declaration

Error in lib/web_worker/PaxHeader/worker.dart and parts: Expected a method, getter, setter or operator declaration

Error in lib/web_worker/PaxHeader/worker.dart and parts: Unexpected token '='

package:analyzer/analyzer.dart 112                                   _parseSource
package:analyzer/analyzer.dart 40                                    parseCompilationUnit
package:angular2/src/transform/directive_processor/rewriter.dart 31  createNgMeta.<async>
dart:async-patch/async_patch.dart 27                                 _asyncThenWrapperHelper.<fn>
dart:async/zone.dart 914                                             _rootRunUnary
dart:async/zone.dart 810                                             _CustomZone.runUnary
dart:async/future_impl.dart 551                                      _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 637                                      _Future._propagateToListeners
dart:async/future_impl.dart 414                                      _Future._complete
dart:async/future_impl.dart 52                                       _SyncCompleter.complete
package:angular2/src/transform/common/logging.dart 26                logElapsedAsync.<async>
dart:async-patch/async_patch.dart 27                                 _asyncThenWrapperHelper.<fn>
dart:async/zone.dart 914                                             _rootRunUnary
dart:async/zone.dart 810                                             _CustomZone.runUnary
dart:async/future_impl.dart 551                                      _Future._propagateToListeners.handleValueCallback
dart:async/future_impl.dart 637                                      _Future._propagateToListeners
dart:async/future_impl.dart 424                                      _Future._completeWithValue
dart:async/future_impl.dart 479                                      _Future._asyncComplete.<fn>
dart:async/zone.dart 907                                             _rootRun
dart:async/zone.dart 802                                             _CustomZone.run
dart:async/zone.dart 735                                             _CustomZone.bindCallback.<fn>
dart:async/schedule_microtask.dart 41                                _microtaskLoop
dart:async/schedule_microtask.dart 50                                _startMicrotaskLoop
dart:isolate-patch/isolate_patch.dart 96                             _runPendingImmediateCallback
dart:isolate-patch/isolate_patch.dart 149                            _RawReceivePortImpl._handleMessage

package:analyzer/analyzer.dart 112                                   _parseSource
package:analyzer/analyzer.dart 40                                    parseCompilationUnit
package:angular2/src/transform/directive_processor/rewriter.dart 31  createNgMeta.<async>
dart:async                                                           _SyncCompleter.complete
package:angular2/src/transform/common/logging.dart 26                logElapsedAsync.<async>
[Info from Dart2JS]:
Compiling angular2_test|web/index.dart...
[Info from Dart2JS]:
Took 0:00:13.599185 to compile angular2_test|web/index.dart.
Built 945 files to "build".
Process finished with exit code 0

This project build fine with beta7 only get this with beta8, pub cache repair has no effect

@mofirouz
Copy link

mofirouz commented Mar 4, 2016

Are you sure about this? I just updated to beta8 with the dart 1.14.2 and everything compiled fine for me?

@jrote1
Copy link
Author

jrote1 commented Mar 4, 2016

@mofirouz Yes I am sure. Have tried it multiple times on different computers and different versions of dart aswell

@vadimtsushko
Copy link

I get the same problem and try to isolate it.
I'm on Windows 8.1. Tried these steps with sdk versions:

  • Dart VM version: 1.14.2 (Tue Feb 09 15:17:24 2016) on "windows_x64"
  • Dart VM version: 1.14.2 (Tue Feb 09 15:17:24 2016) on "windows_x64"

Also, I run pub cache repair

So basically I repeat steps from Angular2 dart quick start: https://angular.io/docs/dart/latest/quickstart.html

  • Create a new project directory

  • Create in it. pubspec.yaml with content

    name: angular2_getting_started
    description: QuickStart
    version: 0.0.1
    environment:
    sdk: '>=1.13.0 <2.0.0'
    dependencies:
    angular2: 2.0.0-beta.8
    browser: ^0.10.0
    transformers:

    • angular2:
      entry_points: web/main.dart
  • create subdirectory web

  • run pub get

pub resolve and downloads packages successfully but breaks with many errors at the transformers step, error log starts with:

Loading source assets...
Loading angular2, observe and smoke/src/default_transformer transformers...
[DirectiveProcessor]:
  Failed with 23 errors
Error 1: line 1, column 1 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
14 uid=263934
^^
Error 2: line 1, column 1 of lib\animate\PaxHeader\testing.dart and parts: Unexpected token '14'
14 uid=263934
^^
Error 3: line 1, column 4 of lib\animate\PaxHeader\testing.dart and parts: Variables must be declared using the keywords 'const', 'final', 'var' or a type name
14 uid=263934
   ^^^
Error 4: line 1, column 8 of lib\animate\PaxHeader\testing.dart and parts: Expected to find ';'
14 uid=263934
       ^^^^^^
Error 5: line 2, column 1 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
20 ctime=1456952280
^^
Error 6: line 2, column 1 of lib\animate\PaxHeader\testing.dart and parts: Unexpected token '20'
20 ctime=1456952280
^^
Error 7: line 2, column 4 of lib\animate\PaxHeader\testing.dart and parts: Variables must be declared using the keywords 'const', 'final', 'var' or a type name
20 ctime=1456952280
   ^^^^^
Error 8: line 2, column 10 of lib\animate\PaxHeader\testing.dart and parts: Expected to find ';'
20 ctime=1456952280
         ^^^^^^^^^^
Error 9: line 3, column 1 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
20 atime=1456952280
^^
Error 10: line 3, column 1 of lib\animate\PaxHeader\testing.dart and parts: Unexpected token '20'
20 atime=1456952280
^^
Error 11: line 3, column 4 of lib\animate\PaxHeader\testing.dart and parts: Variables must be declared using the keywords 'const', 'final', 'var' or a type name
20 atime=1456952280
   ^^^^^
Error 12: line 3, column 10 of lib\animate\PaxHeader\testing.dart and parts: Expected to find ';'
20 atime=1456952280
         ^^^^^^^^^^
Error 13: line 4, column 1 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
23 SCHILY.dev=16777220
^^
Error 14: line 4, column 1 of lib\animate\PaxHeader\testing.dart and parts: Unexpected token '23'
23 SCHILY.dev=16777220
^^
Error 15: line 4, column 14 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
23 SCHILY.dev=16777220
             ^
Error 16: line 4, column 14 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
23 SCHILY.dev=16777220
             ^
Error 17: line 4, column 14 of lib\animate\PaxHeader\testing.dart and parts: Unexpected token '='
23 SCHILY.dev=16777220
             ^
Error 18: line 5, column 14 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
24 SCHILY.ino=217644821
             ^
Error 19: line 5, column 14 of lib\animate\PaxHeader\testing.dart and parts: Expected a method, getter, setter or operator declaration
24 SCHILY.ino=217644821
             ^
Error 20: line 5, column 14 of lib\animate\PaxHeader\testing.dart and parts: Unexpected token '='
24 SCHILY.ino=217644821 

@vadimtsushko
Copy link

Update: If I downlgrade angular2 version to 2.0.0-beta.8 pub get runs successfully

@dougmill
Copy link

dougmill commented Mar 6, 2016

I'm getting this same error, and I've tracked it down to the combination of updating both Angular2 and something else. The "something else" is variable. My first find was code_transformers, which at version 0.2.11 produces the error in combination with angular2 beta 8. I have subsequently tried to update other dependencies while leaving code_transformers alone, however, and that also in some cases produces this error.

Oddly, once I get the error it doesn't go away, even if I revert the other dependency upgrade, until I change angular2 version - even when changing angular2 right back to beta 8 gets no error.

Checking inside angular2, beta 8 adds a PaxHeader folder that contains many dart files that all look like this:

14 uid=263934
20 ctime=1456952280
20 atime=1456952280
23 SCHILY.dev=16777220
24 SCHILY.ino=217644825
18 SCHILY.nlink=1

The SCHILY.ino number is different in each file, but the rest are all the same in every file I've checked. This is not valid Dart syntax, and apparently there are multiple disparate recent updates that detect that where previously it was ignored.

@mhevery
Copy link
Contributor

mhevery commented Mar 7, 2016

Where is lib/web_worker/PaxHeader/worker.dart file coming from? There is no such thing as PaxHeader in angular repository.

@vadimtsushko
Copy link

In my environment to reproduce the bug I just have to put that pubspec.yaml into empty directory and run pub get

name: angular2_getting_started
description: QuickStart
version: 0.0.1
environment:
  sdk: '>=1.13.0 <2.0.0'
dependencies:
  angular2: 2.0.0-beta.8
  browser: ^0.10.0
transformers:
- angular2:
    entry_points: web/main.dart

@vadimtsushko
Copy link

I'm on Dart VM version: 1.15.0-dev.5.0 (Wed Mar 02 04:39:03 2016) on "windows_x64"
But I've tried it with stable version of sdk too

@dougmill
Copy link

dougmill commented Mar 7, 2016

Where is lib/web_worker/PaxHeader/worker.dart file coming from? There is no such thing as PaxHeader in angular repository.

From the Dart package version of Angular2. Running pub get with Angular2's version set to beta 8 results in getting this:
Angular2 contents

Each of the .dart files in both PaxHeader folders looks like the 6-line sample I posted above.

@munificent
Copy link
Contributor

There is no such thing as PaxHeader in angular repository.

Looks like it's implicitly created by tar on Windows when unpacking certain archives. Was 2.0.0-beta.8 published from a Linux or OS X machine with an unusual version of tar?

https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=paxheaders

https://www.gnu.org/software/tar/manual/html_section/tar_71.html

@BorisNaguet
Copy link

Hello,

I just downloaded the file from https://storage.googleapis.com/pub.dartlang.org/packages/angular2-2.0.0-beta.8.tar.gz

On windows, opening it with 7-zip, I have these PaxHeader files (but not on linux!), so it's not specific to pub.

Apparently it's not a new problem:
#5599
and even left some traces:
https://github.com/Ivo-Balbaert/dart_cookbook/tree/master/Chapter%2011/angular_controller/web/packages/angular/PaxHeader

@mhevery
Copy link
Contributor

mhevery commented Mar 9, 2016

@vsavkin you were the last person to cut the build. Anything unusual about your tar setup?

@BorisNaguet
Copy link

The new beta.9 is ok. Maybe it should be the mentioned version in the "5 min Quickstart".

@kwalrath
Copy link
Contributor

Thanks for letting us know, @BorisNaguet. I'll update the samples and quickstart.

@mhevery
Copy link
Contributor

mhevery commented Mar 11, 2016

OK, sounds like this is resolved. Closing

@mhevery mhevery closed this as completed Mar 11, 2016
@jrote1
Copy link
Author

jrote1 commented Mar 31, 2016

@mhevery Can this be re-opened as this same error has returned in beta13

@jrote1
Copy link
Author

jrote1 commented Mar 31, 2016

Last comment on this issue could be related owncloud/core#5783

@jrote1
Copy link
Author

jrote1 commented Mar 31, 2016

Some further investigation shows it could be a Mac issue as the default format is BSD apposed to GNU as seen in this issue http://superuser.com/questions/318809/linux-os-x-tar-incompatibility-tarballs-created-on-os-x-give-errors-when-unt

@jeffbcross
Copy link
Contributor

I'm looking into this

@jeffbcross jeffbcross reopened this Mar 31, 2016
@jeffbcross jeffbcross self-assigned this Mar 31, 2016
@jeffbcross
Copy link
Contributor

@jrote1 would you please try installing 2.0.0-beta.13.1 from pub and verify that it is correct?

@jrote1
Copy link
Author

jrote1 commented Mar 31, 2016

@jeffbcross yes that is correct, what was the issue?

@jeffbcross
Copy link
Contributor

@jrote1 great! The build was generated with a version of the Dart SDK that apparently produces bad tars. I'm going to add something to our build process to require SDK v1.14.2 or greater to prevent this from happening again.

@jrote1
Copy link
Author

jrote1 commented Mar 31, 2016

@jeffbcross cool glad you got to the bottom of it was a strange one

jeffbcross added a commit to jeffbcross/angular that referenced this issue Apr 1, 2016
Two gulp tasks, check-dart-version and enforce-dart-version, will compare the dart
and pub sdk versions against a constant minimum SDK version defined in gulpfile.js.
check-dart-version will log the result, while enforce-dart-version will throw an 
exception if either dart or pup versions are below the minimum required version.

gulp enforce-dart-version has been added to the pub_publish script to prevent
publishing invalid artifacts to pub.

Closes angular#7860
Closes angular#7395
jeffbcross added a commit to jeffbcross/angular that referenced this issue Apr 1, 2016
Two gulp tasks, check-dart-version and enforce-dart-version, will compare the dart
and pub sdk versions against a constant minimum SDK version defined in gulpfile.js.
check-dart-version will log the result, while enforce-dart-version will throw an
exception if either dart or pup versions are below the minimum required version.

gulp enforce-dart-version has been added to the pub_publish script to prevent
publishing invalid artifacts to pub.

Closes angular#7860
Closes angular#7395
@pkozlowski-opensource
Copy link
Member

Obsolete.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants