Skip to content

Failed to construct 'WRWebGLBinding' #79

Description

@saori-eth

Sorry if I am dumb, but I have been building a webxr app for a few weeks, everything was running smoothly until one day I randomly started getting this error.

Image

Notes:

  • Latest Windows version
  • Latest Chrome version
  • Have wiped all cache/storage in my app
  • Have tried Brave (same err)
  • Still is working on chrome on my macbook

Workaround (forces legacy XR path)
Temporarily removing createProjectionLayer from XRWebGLBinding makes the app fall back to the older, stable rendering path:

async function withLegacyXrLayerFallback(fn) {
  if (typeof XRWebGLBinding === "undefined") {
    return await fn();
  }

  const proto = XRWebGLBinding.prototype;
  const descriptor = Object.getOwnPropertyDescriptor(
    proto,
    "createProjectionLayer"
  );

  try {
    if (descriptor) {
      delete proto.createProjectionLayer;
    }
    return await fn();
  } finally {
    if (descriptor) {
      Object.defineProperty(proto, "createProjectionLayer", descriptor);
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions