How to fix "TypeError: Cannot set properties of undefined (setting 'adapter') at new WebGLAdapter" with vite dev mode? #9644
-
I have a React project that uses Deck.gl. The app has been working fine for several weeks, and is in production without issue. However, yesterday, while developing, the app started crashing with these errors in the console:
I rolled back all my changes back, then when that didn't work, I completely deleted the local repo and checked out the working production branch. I cleared all The error occurs on both chrome and safari, but our staging and production versions are running fine in the same browsers. If I build the project with If I comment out all
...then the app crashes again. Even if this code is never called (ie. Its just in a function, but the function call is commented out). I tried delaying the module loading - eg. Looks like I'm using the latest version of deck - 9.1.12 A colleague is working on the exact same codebase without issue (so far). I have absolutely no idea what has changed in my environment, or how to get it working again??? UPDATE: I had another colleague check out the codebase from scratch, and they get the same issue. So I'm guessing its a matter of time before my other colleague sees the issue. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In case anyone stumbles across this post... I managed to track down a previous version of the codebase that would run in
to
which introduces the issue, although not immediately. I think it was re-installing dependencies after making this change, which uncovers the error. |
Beta Was this translation helpful? Give feedback.
In case anyone stumbles across this post...
I managed to track down a previous version of the codebase that would run in
vite
dev mode. Finally, I isolated the change which caused this error. It was changing this line from:import { GeoJsonLayer } from 'deck.gl';
to
import { GeoJsonLayer } from '@deck.gl/layers';
which introduces the issue, although not immediately. I think it was re-installing dependencies after making this change, which uncovers the error.