glimmerjs / glimmer-vm

MIT License
1.13k stars 191 forks source link

Using Custom Elements is broken since Glimmer v0.22.0 #453

Closed dunnkers closed 7 years ago

dunnkers commented 7 years ago

Problem

Since Glimmer v0.22.0 using custom elements created with Polymer nested inside each other does not work.

My addon ember-polymer did not pass tests since ember 2.13.0-beta.1. All the tests basically do is try to render a custom element and check whether it was successful. I noticed the cause was the upgrade to Glimmer v0.22.0, since the errors are thrown by glimmer code. The error occurs only when custom elements are nested inside each other.

Reproduction

Ember Twiddle does not work with beta versions of ember. Therefore I created a repository called glimmer-bug-example to show the error.

Using ember v2.12.0 (glimmer < v0.22.0) screen shot 2017-04-03 at 16 52 24 (master branch)

Using ember v2.13.0-beta.1 (glimmer ^ v0.22.0) screen shot 2017-04-03 at 16 54 13 full error log (ember-beta branch)

This error does though, only occur when nesting custom elements. Just using custom elements is just fine:

screen shot 2017-04-03 at 16 59 59

Solving this problem

It would be great if someone takes a look at this! I think there might be some conflicting mechanisms in Glimmer's DOM processing and in the custom elements spec.

rwjblue commented 7 years ago

Thank you for the detailed bug report and digging that you have done to track this down!

rwjblue commented 7 years ago

Looks like we do not register a statement for Component wireformat opcode (which is number 9 in this enum).

I'm not quite sure of the right implementation for it, but that seems to be the issue.

@chadhietala - Do you have an idea on what the implementation should be?

JackCA commented 7 years ago

just hit this issue as well -- let me know if I can provide any additional context that would be helpful

rwjblue commented 7 years ago

@JackCA - You hit this in Ember 2.13?

JackCA commented 7 years ago

@rwjblue yessir

JackCA commented 7 years ago

@rwjblue let me know if I can provide any specific information that will help. I'm using a combination of tagless and custom-tag components

backspace commented 7 years ago

This has also broken ember-paper for me on Ember 2.13, specifically the paper-chips component. After updating, the main content area of my application wasn’t rendering, with this error in the console:

ember.debug.js:19829 Error: expected an implementation for 6

Stacktrace
    at Object.debugAssert [as assert] (ember.debug.js:1498)
    at Compilers.compile (ember.debug.js:1201)
    at compileStatement (ember.debug.js:1200)
    at ember.debug.js:1200
    at Array.forEach ()
    at WrappedBuilder.compile (ember.debug.js:1200)
    at ComponentLayoutBuilder.compile (ember.debug.js:1173)
    at Object.compileLayout (ember.debug.js:1173)
    at Cache._emberMetal.Cache.owner [as func] (ember.debug.js:11330)
    at Cache.get (ember.debug.js:18578)

Thanks to @rwjblue’s suggestion on the Ember Community Slack, I changed the relevant template from having md-chips-wrap and md-chip elements to have divs instead and the error disappeared.

If there’s any additional information that would be helpful for me to share here, let me know!

kellyselden commented 7 years ago

I'm also getting this with an A-Frame project in 2.12 => 2.13:

<a-scene>
  <a-assets>
    <a-asset-item id="headObj" src="{{rootURL}}tex.obj"></a-asset-item>
    <a-asset-item id="headMtl" src="{{rootURL}}tex.mtl"></a-asset-item>
  </a-assets>

  {{! more stuff }}

</a-scene>

The error is:

ember.debug.js:19829 Error: expected an implementation for 9
    at Object.debugAssert [as assert] (http://localhost:4200/assets/vendor.js:12742:19)
    at Compilers.compile (http://localhost:4200/assets/vendor.js:12445:465)
    at compileStatement (http://localhost:4200/assets/vendor.js:12444:8728)
krisselden commented 7 years ago

Someone mind opening an issue on ember regarding the regression in 2.13? Also, we are working on this, it's just a bit involved.

rwjblue commented 7 years ago

Fixed by https://github.com/glimmerjs/glimmer-vm/pull/488.

dunnkers commented 7 years ago

Great work @rwjblue and @krisselden !

bjornharrtell commented 7 years ago

While this fixes Error: expected an implementation for 9 you can still get Error: expected an implementation for 6. Is this expected error and something that needs be fixed at application level?

Noted in the attempted upgrade for ember-paper here https://github.com/miguelcobain/ember-paper/pull/709.

@backspace described the problem above involving paper-clips.

For what it's worth, I can also get Error: expected an implementation for 16 with some experimentation. If this is also unexpected I can try to isolate it and report separately.

rwjblue commented 7 years ago

@bjornharrtell - please open issues for each of those, we'll need template snippets that cause them to be able to fix...

bjornharrtell commented 7 years ago

@rwjblue great to hear that. I've opened https://github.com/emberjs/ember.js/issues/15258 with two separate jsbin template snippets that demonstrate additional issues.