Repository navigation
fix(ios): undefined is not an object (evaluating 'measureSpec.setColumn') - #7230
Conversation
|
|
||
| this.eachLayoutChild((child, last) => { | ||
| let measureSpecs = this.map.get(child); | ||
| if (!measureSpecs) { |
There was a problem hiding this comment.
I was reviewing our code and I am not sure trying to fix this exceptional situation by registering layout child here is a good idea. How about just skipping this specific layout child instead (as obviously something is not right with its current state)?
if (!measureSpecs) {
continue;
}There was a problem hiding this comment.
I've finally managed to reproduce the problem see: #7226 (comment)
I'm not sure what the best solution is or if we just use components+layouts incorrectly.
Just skipping as you suggest results in the component not being rendered.
There was a problem hiding this comment.
hey @m-abs thank you isolating the problem!
So just skipping the iteration when measureSpec is undefined is not an option, ok. Will investigate the code on the nativescript-angular side a bit but if I don't find a better solution I am going to merge yours as is.
Meanwhile, there is also a workaround that you can use -- wrap the contents of your sub1 component (sub1.component.html) in any kind of layout like this:
<GridLayout>
<ns-sub2></ns-sub2>
</GridLayout>|
test |
chore: cherry-pick community pr #7230
We, the rest of the NativeScript community, thank you for your
contribution!
To help the rest of the community review your change, please follow the instructions in the template.
-->
PR Checklist
[ ] Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/WritingUnitTests.mdWhat is the current behavior?
In the past month we've tracked 20+ crashes with this error:
We haven't been able to consistently reproduce the crash locally, but I think it is clear where it does wrong.
What is the new behavior?
GridLayout(ios).onMeasure(...)will createMeasureSpecsif missing the forchildview when it callsthis.eachLayoutChild(...)Fixes: #7226