Skip to content

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

@szehao

Description

@szehao

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

Activity

danhollick

danhollick commented on Apr 3, 2022

@danhollick

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

danhollick

danhollick commented on Apr 4, 2022

@danhollick

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?

alejandrozeppelinlabs

alejandrozeppelinlabs commented on Jun 3, 2022

@alejandrozeppelinlabs

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.

SebasScript

SebasScript commented on Jun 13, 2022

@SebasScript

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

ktingvoar

ktingvoar commented on Jun 24, 2022

@ktingvoar

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?

eric-taix

eric-taix commented on Jul 6, 2022

@eric-taix

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.

puckey

puckey commented on Jul 6, 2022

@puckey
Collaborator

@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

eric-taix commented on Jul 6, 2022

@eric-taix

@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.

gabriellebaudy

gabriellebaudy commented on Jul 7, 2022

@gabriellebaudy
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @puckey@eric-taix@ktingvoar@danhollick@gabriellebaudy

      Issue actions

        Uncaught (in promise) TypeError: M is not a function · Issue #89 · pmndrs/detect-gpu