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

JS version of polymer chessboard app does not work #20280

Closed
DartBot opened this issue Jul 30, 2014 · 15 comments
Closed

JS version of polymer chessboard app does not work #20280

DartBot opened this issue Jul 30, 2014 · 15 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-duplicate Closed in favor of an existing report P1 A high priority bug; for example, a single project is unusable or has many test failures

Comments

@DartBot
Copy link

DartBot commented Jul 30, 2014

This issue was originally filed by [email protected]


What steps will reproduce the problem?

  1. Clone https://github.com/andersforsell/chessboard.dart/tree/647c45570295f353e4b8796e6078c17ce0cf6202
  2. Run 'example/app.html' as Javascript (or run 'pub build' and open 'build/example/app.html' in Chrome 36)

What is the expected output? What do you see instead?

The expected output is the chessboard as when running in Dartium.
(in Dartium it works fine, except some text appears briefly before the expected content appears)

What version of the product are you using?
Dart Editor version 1.6.0.dev_06_00
Dart SDK version 1.6.0-dev.6.0

On what operating system?
Mac OSX 10.9.4

What browser (if applicable)?
Chrome 36.0.1985.125

Please provide any additional information below.

@DartBot
Copy link
Author

DartBot commented Jul 30, 2014

This comment was originally written by [email protected]


The following error can be seen in the Chrome console window:
"
flushing 29 elements
Uncaught TypeError: Cannot read property 'element' of undefined 127.0.0.1:3030/chessboard.dart/build/example/app.html_bootstrap.dart.js:1509
"

@sethladd
Copy link
Contributor

Removed Priority-Unassigned label.
Added Priority-High, Area-Pkg, Pkg-Polymer, Triaged labels.

@sigmundch
Copy link
Member

Seems like a bug in the polymer.js logic here:

https://github.com/Polymer/polymer-dev/blob/b93ff1fda0e770a10f16d55647da79f3f7aedf18/src/declaration/prototype.js#L208

I'll try to create a small test case for them, but I was able to validate that just changing

  if (p.element)

to:

  if (p && p.element)

fixes the issue.

I'll create a change for them and keep you posted.

meanwhile, if you need to make progress, you can edit your local copy of polymer.html to load polymer.concat.js, and change polymer.concat.js with the patch above.


Added Started label.

@DartBot
Copy link
Author

DartBot commented Jul 31, 2014

This comment was originally written by @kaendfinger


I have this issue as well. Any chance it will be done tonight? This big has set me back quite a bit today :P

@sigmundch
Copy link
Member

I've been looking more into it, and I can't reproduce it on Javascript alone. The polymer code works if the name of the base class is 'null' rather than 'undefined'.

It looks like the issue is in our dart:js layer. dart:js is assuming that null values are 'undefined' in Javascript, but in this case, we need to actually use 'null'.

@sigmundch
Copy link
Member

Indeed - it's a bug from dart:js. See issue #20305.

I'll send a patch for dart:js shortly, but that wont be available until the next build of the -dev channel of the SDK

@sigmundch
Copy link
Member

The fix is now submitted in r38814. As soon as the next dev build is released this should work again.

Meanwhile, one way to work around this is to edit your copy of polymer.js under packages/polymer/src/js/polymer/polymer.js and change this portion:
  b.element?this.findTypeExtension(b.element.extends)

to:
  b&&b.element?this.findTypeExtension(b.element.extends)


Added Duplicate label.
Marked as being merged into #20305.

@sigmundch
Copy link
Member

Another way to fix this is to edit the output of pub-build. The app_bootstrap.dart.js will have a portion like this:

  if(a==null)return
  else if(typeof a==="string"||typeof a==="number"||typeof a==="boolean")return a

Changing it to add null at the end of the first line should fix the issue for you:

  if(a==null)return null
  else if(typeof a==="string"||typeof a==="number"||typeof a==="boolean")return a

@DartBot
Copy link
Author

DartBot commented Aug 1, 2014

This comment was originally written by [email protected]


I'm having the same problem and I don't find any code portion looks like that.

When shall we expect the next dev channel release? Both this issue and issue of pub version conflict with Polymer should be addressed soon

@sigmundch
Copy link
Member

the bots finished building the next release, I expect it will be released after some testing early next week.

@DartBot
Copy link
Author

DartBot commented Aug 3, 2014

This comment was originally written by [email protected]


Siggi's suggestion in #­7 let me build so it runs in Chrome, but it remains broken in Safari with: http://d.pr/i/I3Lz See http://mycommunity.org for a live example (running on GCE by the way!).

@DartBot
Copy link
Author

DartBot commented Aug 4, 2014

This comment was originally written by [email protected]


Confirming that the suggestion in #­8 had the same effect: works in Chrome, does not work in Safari:

[Error] Element name could not be inferred.
    b (polymer.js, line 12)
    (anonymous function) (mycommunity.org, line 4950)

@sigmundch
Copy link
Member

Hey Dave, cool to see the live example! :) - It sounds like the issue you see in Safari is something unrelated though. I've opened a separate bug to track that here: https://code.google.com/p/dart/issues/detail?id=20354

If you have an example we can build locally that runs into the error, could you please post it there?

Thanks!

@DartBot
Copy link
Author

DartBot commented Aug 4, 2014

This comment was originally written by [email protected]


Hi Siggi. Pull and checkout the Dev branch at
http://github.com/DaveNotik/dart-stack, create a lib/config/config.dart
using the example in that same dir (the directory should be build/web), pub
build, and "dart start.dart" to start the server. Looking forward to any
guidance!

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-archive/polymer-dart#254.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. closed-duplicate Closed in favor of an existing report P1 A high priority bug; for example, a single project is unusable or has many test failures
Projects
None yet
Development

No branches or pull requests

3 participants