Nanfeng

Notes on software development, code, and curious ideas

Fix Cocos Creator Cannot Read Properties of Null (reading getGFXTexture)

Identify the getGFXTexture Null Error

The browser repeatedly reported Cannot read properties of null (reading 'getGFXTexture'):

Error

Trace the Invalid SpriteFrame by UUID

The underlying image texture had become invalid or empty. Enable Cocos source debugging in VS Code, stop at the failing frame, and inspect the frame object:

Debugger frame

Copy its uuid, search for it in the Cocos Creator Assets panel, then use Find UUID References on that image:

UUID search

Fix the broken asset or reference rather than merely suppressing the null error.

+