Hi Gabby,
I’ve attempted to implement the code you provided (for creating a CesiumJS Viewer with a WebGL stub) in my React (TypeScript + Resium) project. However, I’m still encountering the same error.
Here is my code:
"
import getWebGLStub from “./getWebGLStub”;
import { ContextOptions, Viewer, defaultValue } from “cesium”;
declare global {
interface Window {
webglStub?: boolean;
}
}
function createViewer(container: Element | string, options: Viewer.ConstructorOptions = {}) {
options = defaultValue(options, {});
options.contextOptions = defaultValue(options.contextOptions, {}) as ContextOptions;
options.contextOptions.webgl = defaultValue(options.contextOptions.webgl, {});
if (!!window.webglStub) {
options.contextOptions.getWebGLStub = getWebGLStub;
}
return new Viewer(container, options);
}
export default createViewer;
"
Could you please assist me in identifying what I might have missed or misconfigured?
Thank you.