pmndrs/detect-gpu

Uncaught (in promise) TypeError: M is not a function

szehao opened this issue · 9 comments

Works fine locally, but not on production.

On create-react-app v5.0.0

Other users having same issue on separate issue : #86 (comment)

image

Having this same issue
Screenshot 2022-04-03 at 19 19 39

Happening on all browsers across multiple devices.
Another one here:
#88

My packages:

"gatsby": "4.7.2",
"webpack": "^5.69.1"
"detect-gpu": "^4.0.16"

or with useDetectGPU

"@react-three/drei": "8.20.2"

@TimvanScherpenzeel is there something we can do to help debug this issue? I'm not even sure where to start

Have tracked down this breaking change to version 4.0.0.
3.1.3 works as expected but doesn't report apple M1s correctly.

The fact that the demo works fine and it works on the dev server indicates that there is something happening in the bundling process between webpack/babel.

@puckey It looks like you did quite a lot of work on that release - do you have any clue what might be causing this?

Hey, I am having the same problem! Is there any solution for this? I tried version 3.1.3 but is not working correctly on apple devices.

same issue here with new version of create react app that uses webpack 5

This issue has been blocking me for a while now too. Did some cursory hunting, and removing the terser plugin from the rollup config seemed to fix the issue in our environment. Is it necessary?

I know that maintaning opensource project is time consuming, but do you have any plan to fix this issue?

For now we're unable to build a production version which is annoying for our business. I'm pretty sure that many people using this library would like to help.

@eric-taix Right above your +1 comment someone seems to be pushing commits purporting to fix this issue. How about asking them to open a PR or review the commits yourself and open a PR?

@eric-taix Right above your +1 comment someone seems to be pushing commits purporting to fix this issue. How about asking them to open a PR or review the commits yourself and open a PR?

This is one of my coworker who's trying to fix this issue (typically by removing terser as suggested here). And of course if we fix it, we'll open a PR ;-) For now, this is far from being solved.

If a maintainer could give us some advice(s) / idea(s) it would be probably more efficient.

Hello,

I found and submitted a fix for this issue, you can have a look here.

As it's a small but important fix we might expect to have it packaged soon I hope!