localvoid / vdom-benchmark

Virtual DOM diff/patch benchmark
BSD 2-Clause "Simplified" License
49 stars 10 forks source link

Dart2JS crash on OS X #8

Closed pygy closed 9 years ago

pygy commented 9 years ago

I get a dart2js crash on OS X (with both Dart v1.6 and 1.8):

I reported the issue upstream, but I wanted to let you know.

$ pub build --mode=release
Loading source assets...
Loading smoke/src/default_transformer transformers... (1.1s)
Building vdom_benchmark...
[Info from Dart2JS]:
Compiling vdom_benchmark|web/components.dart...
[Warning from Dart2JS on vdom_benchmark|web/components.dart]:
1 hint(s) suppressed in package:charted.
[Info from Dart2JS]:
Took 0:00:09.905975 to compile vdom_benchmark|web/components.dart.
[Info from Dart2JS]:
Compiling vdom_benchmark|web/index.dart...
[Error from Dart2JS on vdom_benchmark|web/index.dart]:
packages/vdom_benchmark/vdom.dart:38:8:
The compiler crashed when compiling this element.
  void update() {
       ^^^^^^
The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

* the name and version of your operating system,

* the Dart SDK build number (build number could not be determined), and

* the entire message you see here (including the full stack trace
  below as well as the source location above).

Build error:
Transform Dart2JS on vdom_benchmark|web/index.dart threw error: The null object does not have a getter 'source'.

NoSuchMethodError: method not found: 'source'
Receiver: null
Arguments: []
dart:core                                                                                                                      Object.noSuchMethod
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 1115  TypeCheckerVisitor.visitSend
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/tree/nodes.dart 363    Send.accept
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 406   TypeCheckerVisitor.analyze
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 380   TypeCheckerVisitor.analyzeNonVoid
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 1609  TypeCheckerVisitor.visitVariableDefinitions
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/tree/nodes.dart 1184   VariableDefinitions.accept
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 406   TypeCheckerVisitor.analyze
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 1535  TypeCheckerVisitor.visitNodeList
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/tree/nodes.dart 540    NodeList.accept
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 406   TypeCheckerVisitor.analyze
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 534   TypeCheckerVisitor.visitBlock
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/tree/nodes.dart 587    Block.accept
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 406   TypeCheckerVisitor.analyze
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 609   TypeCheckerVisitor.visitFunctionExpression
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/tree/nodes.dart 732    FunctionExpression.accept
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 21    TypeCheckerTask.check.<fn>.<fn>
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1997     CompilerTask.measure
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 14    TypeCheckerTask.check.<fn>
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 810      Compiler.withCurrentElement
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/typechecker.dart 13    TypeCheckerTask.check
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1610     Compiler.analyzeElement
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1631     Compiler.analyze
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 46       ResolutionWorkItem.run
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1538     Compiler.processQueue.<fn>.<fn>
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 810      Compiler.withCurrentElement
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1538     Compiler.processQueue.<fn>
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/enqueue.dart 874       QueueFilter.processWorkItem
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/enqueue.dart 610       Enqueuer.forEach
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1537     Compiler.processQueue
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1410     Compiler.compileLoadedLibraries
/Volumes/data/b/build/slave/dart-editor-mac-stable/build/dart/sdk/lib/_internal/compiler/implementation/compiler.dart 1321     Compiler.runCompiler.<fn>
dart:isolate                                                                                                                   _RawReceivePortImpl._handleMessage

Build failed.
localvoid commented 9 years ago

Fixed, vdom/liquid now using stable versions from pub repository instead of github.

pygy commented 9 years ago

Now pub works, but I can't get the local version to run. I get the following in the Chrome console:

Note that I run pub serve --mode=release --port=8888, with a specific port since I don't know what pub uses by default.

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8888/js/main.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8888/index.dart
Uncaught Uncaught Error: NullError: Cannot call "V7" on null
Stack Trace:
TypeError: Cannot read property 'V7' of undefined
    at cy.St (http://localhost:8888/index.dart.js:6416:28)
    at VW.$1 (http://localhost:8888/index.dart.js:5796:3)
    at R8.FI (http://localhost:8888/index.dart.js:3352:42)
    at rq.$0 (http://localhost:8888/index.dart.js:2823:17)
    at dart.vs.static.HZ (http://localhost:8888/index.dart.js:2765:59)
    at vs.HH (http://localhost:8888/index.dart.js:2686:3)
    at mJ.oo (http://localhost:8888/index.dart.js:2647:3)
    at mJ.oo [as tZ] (http://localhost:8888/index.dart.js:2647:34)
    at eval [as $0] (eval at <anonymous> (http://localhost:8888/index.dart.js:1212:8), <anonymous>:2:34)
    at Av.$0 (http://localhost:8888/index.dart.js:971:8) index.dart.js:1057
localvoid commented 9 years ago

It seems that it can't find javascript files

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8888/js/main.js

NODE_ENV=production gulp should fix this

And all 404 on .dart files can be ignored in --mode=release

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8888/index.dart
pygy commented 9 years ago

I reran gulp to be sure, but it still doesn't work. web/js/main.js exists.

Here's the server log after trying to load the page twice:

$  pub serve --mode=release --port=8888                                                                                                                                                                      ⏎
Loading source assets...
Loading smoke/src/default_transformer transformers... (1.1s)
Serving vdom_benchmark web on http://localhost:8888
Build completed successfully
[web] GET / → vdom_benchmark|web/index.html
[web] GET /js/main.js → Could not find asset vdom_benchmark|web/js/main.js.
[web] GET /packages/browser/dart.js → browser|lib/dart.js
[Info from Dart2JS]:
Compiling vdom_benchmark|web/index.dart...
[Warning from Dart2JS on vdom_benchmark|web/index.dart]:
1 hint(s) suppressed in package:charted.
[Info from Dart2JS]:
Took 0:00:11.065244 to compile vdom_benchmark|web/index.dart.
Build completed successfully
[web] GET /index.dart.js → vdom_benchmark|web/index.dart.js
[web] GET / → vdom_benchmark|web/index.html
[web] GET /js/main.js → Could not find asset vdom_benchmark|web/js/main.js.
[web] GET /packages/browser/dart.js → browser|lib/dart.js
[web] GET /index.dart.js → vdom_benchmark|web/index.dart.js
localvoid commented 9 years ago

I can't reproduce it (Dart 1.8.0 stable)

$ git clone https://github.com/localvoid/vdom-benchmark.git
...
$ cd vdom-benchmark
$ npm install
...
$ NODE_ENV=production gulp
...
$ pub serve --mode=release --port=8888
Your pubspec has changed, so we need to update your lockfile:
Resolving dependencies... (5.3s)
+ analyzer 0.22.4 (0.23.0-dev.13 available)
+ args 0.12.1
+ barback 0.15.2+2
+ browser 0.10.0+2
+ charted 0.0.7
+ code_transformers 0.2.3+1
+ collection 1.1.0
+ csslib 0.11.0+2
+ dom_scheduler 0.0.1
+ intl 0.11.11
+ liquid 0.2.1
+ logging 0.9.2
+ observe 0.12.2
+ path 1.3.0
+ petitparser 1.3.1
+ pool 1.0.1
+ smoke 0.2.1+1
+ source_maps 0.10.0+1
+ source_span 1.0.2
+ stack_trace 1.1.1
+ utf 0.9.0+1
+ vdom 0.7.1
+ watcher 0.9.3
Downloading liquid 0.2.1...
Changed 23 dependencies!
Precompiling dependencies... 
Loading source assets... 
Loading smoke/src/default_transformer transformers... 
Precompiled smoke.
Loading source assets... 
Loading smoke/src/default_transformer transformers... 
Serving vdom_benchmark web on http://localhost:8888
Build completed successfully
[web] GET / → vdom_benchmark|web/index.html
[web] GET /js/main.js → vdom_benchmark|web/js/main.js
[web] GET /packages/browser/dart.js → browser|lib/dart.js
[Info from Dart2JS]:
Compiling vdom_benchmark|web/index.dart...
[Warning from Dart2JS on vdom_benchmark|web/index.dart]:
1 hint(s) suppressed in package:charted.
[Info from Dart2JS]:
Took 0:00:07.898853 to compile vdom_benchmark|web/index.dart.
Build completed successfully
[web] GET /index.dart.js → vdom_benchmark|web/index.dart.js

It should work if vdom-benchmark/web/js/main.js file exists.

pygy commented 9 years ago

My bad I had a stray Dart v1.6 in the path (installed while trying to get rid of the original problem).

It works here too.