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

Component remove failed on null geometry #5266

Closed
eherve opened this issue Apr 1, 2023 · 2 comments
Closed

Component remove failed on null geometry #5266

eherve opened this issue Apr 1, 2023 · 2 comments

Comments

@eherve
Copy link

eherve commented Apr 1, 2023

Description:

  • A-Frame Version: 1.4.1
  • Platform / Device: Google Chrome / Mac Book

When adding entity text in scene

<a-entity text="value: 10; color: #ffffff; font: roboto; width: 140; wrapCount: 2; baseline: center; align: right; lineHeight: 36;" position="344 190 -70" rotation="0 -90 0"></a-entity>

I have an error on removing the component when the scene document is destroyed.
It seems that the geometry in the Component is null so when calling this.geometry.dispose() in the Component remove function it fails :

aframe-master.js:21557 Uncaught TypeError: Cannot read properties of null (reading 'dispose')
    at NewComponent.remove (aframe-master.js:21558:19)
    at AEntity.removeComponent (aframe-master.js:24891:15)
    at AEntity.disconnectedCallback (aframe-master.js:24617:12)

I printed the component before dispose and i do have a null geometry :

attrName: "text"
attrValue: {value: '9', color: '#ffffff', font: 'roboto', width: 140, wrapCount: 2, …}
currentFont: {pages: Array(1), chars: Array(95), info: {…}, common: {…}, kernings: Array(396), …}
data: {value: '9', color: '#ffffff', font: 'roboto', width: 140, wrapCount: 2, …}
el: a-entity#text.ng-star-inserted
events: {}
evtDetail: {id: undefined, name: 'text'}
geometry: null
id: undefined
initialized: true
isObjectBased: true
isPlaying: false
isSingleProperty: false
isSinglePropertyObject: false
justInitialized: true
material: null
mesh: Mesh {isObject3D: true, uuid: 'fbb5806a-ad9e-489b-bda0-94ce2c740443', name: '', type: 'Mesh', parent: null, …}
nextData: {value: '9', color: '#ffffff', font: 'roboto', width: 140, wrapCount: 2, …}
objectPool: {pool: Array(5120), grow: ƒ, recycle: ƒ, size: ƒ, use: ƒ}
oldData: {value: '9', color: '#ffffff', font: 'roboto', width: 140, wrapCount: 2, …}
parsingAttrValue: {value: '9', color: '#ffffff', font: 'roboto', width: '140', wrapCount: '2', …}
previousOldData: {value: '9', color: '#ffffff', font: 'roboto', width: 140, wrapCount: 2, …}
shaderData: {alphaTest: 0.5, color: '#ffffff', map: Texture, opacity: 1, side: 1, …}
texture: null
throttledEmitComponentChanged: ƒ ()

I tried to manually add a geometry in the a-entity but with no luck.

@dmarcos
Copy link
Member

dmarcos commented Apr 3, 2023

What do you mean by "I have an error on removing the component when the scene document is destroyed" Can you share full runnable code with https://glitch.com/~aframe?

@dmarcos
Copy link
Member

dmarcos commented Nov 3, 2023

Closing for now but if you can provide runnable code to reproduce happy to reopen and look at it.

@dmarcos dmarcos closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants