Uncaught TypeError: t is undefined
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react, typescript
- Domain
- frontend
Research direction
Start with the linked CodeSandbox and reproduce the failure by right-clicking the element using useContextMenu({ id: MENU_ID }) and show. Trace the interaction between show, Menu, and Item until the undefined value is identified. Done means right-clicking opens the menu without the TypeError and the item handler still receives its documented arguments.
Written by the indexing model from the issue text.
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When I right click, I get Uncaught TypeError: t is undefined - full stack below.
My code is:
const MENU_ID = 'MyMenu'
const MyThing = ({....}) => {
const { show } = useContextMenu({
id: MENU_ID,
});
...
function handleItemClick({ event, props, triggerEvent, data }){
console.log(event, props, triggerEvent, data );
}
return (
<div>
...
<Menu id={MENU_ID}>
<Item onClick={handleItemClick}>One</Item>
<Item onClick={handleItemClick}>Two</Item>
</Menu>
<div onContextMenu={show}><p>some stuff here</p></div>
...
</div>
)
}
When I right click I get this in console:
22:08:38.790 Uncaught TypeError: t is undefined
show bundle.js:68203
show bundle.js:68216
React 14
unstable_runWithPriority scheduler.development.js:468
React 15
js index.js:7
factory react refresh:6
Webpack 3
2 bundle.js:68203:5
show bundle.js:68203
show bundle.js:68216
React 14
unstable_runWithPriority scheduler.development.js:468
React 8
forEach self-hosted:4425
React 7
js index.js:7
factory react refresh:6
Webpack 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:
Sure, though I get a slightly different stack trace (X is not a function) on CodeSandbox: https://codesandbox.io/s/react-contexify-issue-255-t6fthr
What is the expected behavior?
It doesn't fail.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Firefox 117 (Linux), CodeSandbox.
React 17.0.2, Contexify 6.0.0
- Dominant language
- TypeScript
- Stars
- 1.2k
- Forks
- 133
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fkhadra/react-contexify
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
fkhadra/react-contexify#275 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
fkhadra/react-contexify#269 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
fkhadra/react-contexify#268 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
fkhadra/react-contexify#265 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
fkhadra/react-contexify#264 · 1 comment ·
All issues in fkhadra/react-contexify
Similar issues
-
Unsampled pageload span is profiled when profileLifecycle is 'trace' (browser UI profiling)Possibly taken @Jxxunnn claimed this today. OpenBrowser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
getsentry/sentry-javascript#25497 · 1 comment ·
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
redhat-developer/rhdh-plugin-export-overlays#4438 · 1 comment ·
Maintainers usually reply within 1 day
-
resource: destroying a resource calls AbortController.abort() without a reason, creating an AbortError with a stack trace each timePossibly taken A pull request linked to this issue is open or already merged. Openarea: core
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
angular/angular#71422 · 1 comment ·
Maintainers usually reply within 1 day
-
bug status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
facebook/docusaurus#12739 · 1 comment ·
Maintainers usually reply within 1 day
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day