Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Uncaught TypeError: X is not a function" in Menu.tsx #241

Open
bhufmann opened this issue Feb 15, 2023 · 3 comments
Open

"Uncaught TypeError: X is not a function" in Menu.tsx #241

bhufmann opened this issue Feb 15, 2023 · 3 comments

Comments

@bhufmann
Copy link

bhufmann commented Feb 15, 2023

Do you want to request a feature or report a bug?
Bug. Not sure if it's a bug. It might be in my environment. I'm looking for help to resolve issue.

What is the current behavior?
I implementing a context menu using react-contexify v6.0.0 and I get the following exception and my component is not rendered:

react-dom.development.js:26923 Uncaught TypeError: X is not a function
    at S (Menu.tsx:3:3)
    at it (Menu.tsx:3:3)
    at renderWithHooks (react-dom.development.js:16305:1)
    at mountIndeterminateComponent (react-dom.development.js:20074:1)
    at beginWork (react-dom.development.js:21587:1)
    at beginWork$1 (react-dom.development.js:27426:1)
    at performUnitOfWork (react-dom.development.js:26560:1)
    at workLoopSync (react-dom.development.js:26466:1)
    at renderRootSync (react-dom.development.js:26434:1)
    at recoverFromConcurrentError (react-dom.development.js:25850:1)

The Chrome dev tools show the error on the following line of Menu.tsx:3:3

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your CodeSandbox (https://codesandbox.io/s/new) example below:
I don't have simple example to reproduce. I'm in development of a full-stack application with a lot changes to use the context menu.

What is the expected behavior?
No exception and component is rendered

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
I'm using react v18.2.0. I'm running Linux (Ubuntu 18.04). It happens with recent Chrome browser.
I tried using react-contexify v5.0.0 and I don't see that error. However, I see flashing menu when it's being closed which is supposed to be fixed in v6.0.0.

@hollowaybt
Copy link

hollowaybt commented Feb 20, 2023

Confirmed I am hitting the same issue described above with 6.0.0 following the example in the "gist". Dropped the version of react-contexify to 5.0.1-1 and seems to be working now without any code changes.

If it helps here are the packages I'm using in case there is some weird interaction (list generated after dropping to rev 5.0.1-1).

├── @apollo/[email protected]
├── @babel/[email protected]
├── @babel/[email protected]
├── @babel/[email protected]
├── @babel/[email protected]
├── @projectstorm/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

@shubham-solytics
Copy link

shubham-solytics commented Aug 29, 2023

I'm facing same issue with react-contexify v6.0.0.
Appears to be some issue with clsx dependency.

@joaopbnogueira
Copy link

Forcing react-contexify to use clsx 2.0.0 through overrides solved the issue for me.

@fkhadra since upgrading to 2.0.0 should be fine according to the release notes, is this something that you'd be willing to accept?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants