You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above is in the file Skia.web.js which uses global.CanvasKit to create a Skia object. The LoadSkiaWeb adds CanvasKit to global. I am using Next js and the renderNode function of skia is running before the CanvasKit is added to global.
Even though I am loading the entire react tree only after LoadSkiaWeb is done.
(I've set a timeout only for testing)
The below is the error i get
Uncaught TypeError: Cannot read properties of undefined (reading 'Matrix')
at Object.Matrix (JsiSkia.js:56:115)
at new JsiRenderNode (RenderNode.js:16:29)
at new GroupNode (GroupNode.js:5:5)
at JsiSkDOM.Group (JsiSkDOM.js:19:105)
at new Container (Container.js:14:26)
at new SkiaRoot (Reconciler.js:17:22)
at eval (Canvas.js:48:30)
at mountMemo (react-dom.development.js:17225:1)
at Object.useMemo (react-dom.development.js:17670:1)
at useMemo (react.development.js:1650:1)
at eval (Canvas.js:48:23)
at renderWithHooks (react-dom.development.js:16305:1)
at updateForwardRef (react-dom.development.js:19226:1)
at beginWork (react-dom.development.js:21636:1)
at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
at invokeGuardedCallback (react-dom.development.js:4277:1)
at beginWork$1 (react-dom.development.js:27451:1)
at performUnitOfWork (react-dom.development.js:26557:1)
at workLoopSync (react-dom.development.js:26466:1)
at renderRootSync (react-dom.development.js:26434:1)
at performConcurrentWorkOnRoot (react-dom.development.js:25738:1)
at workLoop (scheduler.development.js:266:1)
at flushWork (scheduler.development.js:239:1)
at MessagePort.performWorkUntilDeadline (scheduler.development.js:533:1)
I've debugged and the error is in JsiSkia.js on line 56: Matrix: matrix => new JsiSkMatrix(CanvasKit, matrix ? Float32Array.of(...matrix) : Float32Array.of(...CanvasKit.Matrix.identity())),
CanvasKit which is passed as a constructor (as global.CanvasKit form the caller) is undefined
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
The above is in the file
Skia.web.js
which usesglobal.CanvasKit
to create aSkia
object. TheLoadSkiaWeb
addsCanvasKit
toglobal
. I am using Next js and therenderNode
function of skia is running before theCanvasKit
is added toglobal
.Even though I am loading the entire react tree only after
LoadSkiaWeb
is done.(I've set a timeout only for testing)
The below is the error i get
I've debugged and the error is in
JsiSkia.js
on line 56:Matrix: matrix => new JsiSkMatrix(CanvasKit, matrix ? Float32Array.of(...matrix) : Float32Array.of(...CanvasKit.Matrix.identity())),
CanvasKit
which is passed as a constructor (asglobal.CanvasKit
form the caller) isundefined
Beta Was this translation helpful? Give feedback.
All reactions