model-viewer
model-viewer copied to clipboard
Tests without WebGL Context
@google/model-viewer v4.0.0 (also tried v3.5.0)
When running tests in CI (GitHub Actions, without a screen), there seems to be an issue i was not having before:
TypeError: this.threeRenderer is undefined thrown
and
Uncaught TypeError: Cannot read properties of undefined (reading 'xr') thrown
which come together with (it seems):
Chrome Headless 131.0.0.0 (Mac OS 10.15.7) WARN: Error: Error creating WebGL context.
Error: Error creating WebGL context.
at new WebGLRenderer (http://localhost:9876/_karma_webpack_/webpack:/node_modules/three/build/three.module.js:14906:13)
at new Renderer (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/three-components/Renderer.js:73:34)
at Function.singleton (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/three-components/Renderer.js:103:31)
at new LoadingModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/loading.js:177:22)
at new ARModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/ar.js:58:13)
at new ControlsModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/controls.js:178:13)
at new EnvironmentModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/environment.js:37:13)
at new StagingModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/staging.js:42:13)
at new SceneGraphModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/scene-graph.js:41:13)
at new AnnotationModelViewerElement (http://localhost:9876/_karma_webpack_/@google/webpack:/node_modules/@google/model-viewer/lib/features/annotation.js:35:13)
Hmm, I haven't seen that - I'm guessing something else is different, since our CI is not having this problem. Would you mind sending a PR to see if you can trigger the problem here on our CI?
Seems like you were having the same issue: https://github.com/karma-runner/karma-chrome-launcher/issues/263 Unfortunately, using Angular, it seems like I can't easily migrate off of Karma.
We're currently evaluating Web Test Runner, Vitest, and Jest as candidates for a new test runner for Angular projects while preserving Jasmine as assertion library to not break existing tests.
So it might be a problem of the test runner rather than the library
Oh yeah, Karma is dead. We moved to web-test-runner; it's way better.