Gl-react-expo breaks on import

#1

First time user, running XDE on ubuntu. I hit “new project”, and go with the defaults. Everything goes fine, simple starter project opens up on my phone, I’m unreasonably happy at how easy this is.

I “npm install --save gl-react gl-react-expo”. I add “import {Surface} from ‘gl-react-expo’;” in App.js. No other changes for now, just want to make sure it’s installed. Error pops up on my phone: “Super expression must be either null or undefined”.

I’ve tried clearing npm cache, deleting node_modules and reinstalling multiple times. I’m on npm 4.2.0, so it’s not npm 5.0.0 weirdness. I hit the restart button in XDE, closed and reopened XDE, nuked the whole project and restarted. I tried installing and importing another library (underscore); that works, so I’m pretty sure the problem is gl-react-expo specific.

Two questions. First, am I missing anything obvious, and does anyone know the fix? Second, is this even the right place to ask this question, since it’s (presumably) gl-react-expo specific?

#2

hey! so basically you started an empty project (which worked), then after importing gl-react-expo you received the error?

just checked out the module on npm and looks like it hasn’t been updated for 5 months, there’s most likely some break in the module thats causing the crash.

haven’t done much with WebGL, but expo has a component called GLView that may prove useful for whatever you’re trying to make.

#3

Update: Whatever the default version of gl-react is in npm, it has a completely different api from the version needed by gl-react-expo. Installing the right version of gl-react fixed the problem.

#4

nice! glad to hear you worked it out