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

[BETA and CANARY] block is undefined on tagless and blockless components #13494

Closed
miguelcobain opened this issue May 13, 2016 · 13 comments
Closed
Assignees
Labels

Comments

@miguelcobain
Copy link
Contributor

miguelcobain commented May 13, 2016

I'm getting a TypeError: Cannot read property 'template' of undefined because block is undefined in this line: https://github.com/emberjs/ember.js/blob/master/packages%2Fember-htmlbars%2Flib%2Fhooks%2Fcomponent.js#L57

The tests are ok in ember-release and fail on beta and canary channels.

The tests that fail involve tagless blockless components, so I assume the bug is related to that.

Build log: https://travis-ci.org/miguelcobain/ember-leaflet/jobs/129892214

@Serabe
Copy link
Member

Serabe commented May 13, 2016

Seems related to local lookup. // @rwjblue

@Serabe Serabe added the Bug label May 13, 2016
@krisselden krisselden self-assigned this May 13, 2016
@rwjblue
Copy link
Member

rwjblue commented Jun 9, 2016

This was introduced by 869ed30#diff-7d2b815a163f3a57292f65c26e98c051R56. When no block is passed, there is no state.manager.block.

The first step would be to submit a failing test PR (and also adding a test for a tagless blockless component using local lookup). The fix might be as simple as guarding there, but I suspect to support local lookup in tagless/blockless we will need to tweak the logic.

@asakusuma
Copy link
Contributor

Now that we have a simple repro I'll work on fixing this

@rwjblue
Copy link
Member

rwjblue commented Jun 10, 2016

Thanks @asakusuma

@rwjblue
Copy link
Member

rwjblue commented Jun 10, 2016

I believe this applies to 2.6.0, so it will likely warrant a point release once fixed.

@davidwallacejackson
Copy link

If anybody else is having this problem, a temporary workaround is to add a tag to your tagless component until the point release lands.

@mixonic
Copy link
Member

mixonic commented Jun 26, 2016

@rwjblue @asakusuma this can be closed?

@asakusuma
Copy link
Contributor

@mixonic yes this can be closed

@mixonic
Copy link
Member

mixonic commented Jun 26, 2016

Thanks @asakusuma :-)

@mixonic mixonic closed this as completed Jun 26, 2016
@miguelcobain
Copy link
Contributor Author

Looks like this problem isn't solved yet @asakusuma @rwjblue

I get a null is not an object (evaluating 'sm.scope._view.template.meta') error.

Log: https://travis-ci.org/miguelcobain/ember-leaflet/jobs/146079848

Any idea?

@asakusuma
Copy link
Contributor

@miguelcobain can you provide a failing test PR?

We have a test that is supposed to guard this problem but sounds like we are missing a case.

@miguelcobain
Copy link
Contributor Author

I'll try to come up with a failing test for ember.

Meanwhile,
this is the failing test on ember-leaflet: https://github.com/miguelcobain/ember-leaflet/blob/master/tests/integration/components/tile-layer-test.js#L23-L48

and this is the component being tested: https://github.com/miguelcobain/ember-leaflet/blob/master/addon/components/tile-layer.js

which inherits from: https://github.com/miguelcobain/ember-leaflet/blob/master/addon/components/base-layer.js

Just in case you spot something odd there.

@miguelcobain
Copy link
Contributor Author

miguelcobain commented Jul 26, 2016

I could reproduce the problem in a twiddle: https://ember-twiddle.com/d5f6fc09d9f2a86098012c7304c9e4a6?openFiles=controllers.application.js%2C

Click to change the value, and see an error coming up.
The component is tagless, blockless and templateless, if that has any importance.

@GavinJoyce or me will provide a failing test soon.

asakusuma added a commit to asakusuma/ember.js that referenced this issue Jul 26, 2016
rwjblue pushed a commit that referenced this issue Aug 1, 2016
Addresses #13494

(cherry picked from commit 4a81b5f)
rwjblue pushed a commit that referenced this issue Aug 29, 2016
Addresses #13494

(cherry picked from commit 4a81b5f)
toddjordan pushed a commit to toddjordan/ember.js that referenced this issue Sep 9, 2016
webark pushed a commit to webark/ember.js that referenced this issue Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants