-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Description
Firstly, thanks for your work on this project!
Today I used patch-package to patch @luma.gl/[email protected]
for the project I'm working on.
Here is the diff that solved my problem:
diff --git a/node_modules/@luma.gl/webgl/dist/adapter/webgl-adapter.js b/node_modules/@luma.gl/webgl/dist/adapter/webgl-adapter.js
index 51edaee..023ee3f 100644
--- a/node_modules/@luma.gl/webgl/dist/adapter/webgl-adapter.js
+++ b/node_modules/@luma.gl/webgl/dist/adapter/webgl-adapter.js
@@ -14,8 +14,11 @@ export class WebGLAdapter extends Adapter {
super();
// Add spector default props to device default props, so that runtime settings are observed
Device.defaultProps = { ...Device.defaultProps, ...DEFAULT_SPECTOR_PROPS };
- // @ts-ignore DEPRECATED For backwards compatibility luma.registerDevices
- WebGLDevice.adapter = this;
+ if (typeof WebGLDevice !== 'undefined') {
+ // @ts-ignore DEPRECATED For backwards compatibility luma.registerDevices
+ WebGLDevice.adapter = this;
+ console.log('[PATCH] WebGLDevice.adapter set safely');
+ }
}
/** Check if WebGL 2 is available */
isSupported() {
brycedorn, SeanIFitch, jrdb, ruizmarc, calebwaldner and 1 more
Metadata
Metadata
Assignees
Labels
No labels