Type Error in @headlessui/react
See original GitHub issueI am trying to use Headless UI Select component in a Chrome extension & it gives error: ReferenceError: process is not defined
as process.nextTick
is used.
Is there anyway I can bypass that as process
is not available in Chrome extensions I think? Or maybe can you guys polyfill it? Or I am just a minority.
Edit: I couldn’t find process.nextTick
being used 😃
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Type Error for `Dialog.Panel`: ts(2339) · Issue #1419 - GitHub
A restart/reload of VS Code should do the same thing. Here is a very basic CodeSandbox with React, TypeScript and Headless UI proving...
Read more >typescript errors when using headless ui documentation
From what I understand, React.forwardRef takes two type params. The RefType and the Props Type (backwards from the function params, (props, ...
Read more >Listbox (Select) - Headless UI
For example, the Listbox.Option component exposes an active state, which tells you if the option is currently focused via the mouse or keyboard,...
Read more >How to Use the Dialog Component with Headless UI and ...
Tailwind CSS is one of the most popular options when it comes to styling React applications. You can easily add styles to your...
Read more >TypeError: undefined is not iterable (cannot read property ...
I have made a project close to Instagram using nextjs and headless UI with javascript. When I installed tsconfig to transfer the project...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey! Thank you for your bug report! Much appreciated! 🙏
The TypeScript error that you are receiving is a known issue that has been fixed but not fully released yet. However, if you do want to make use of the fix, try using the dev build:
yarn add @headlessui/react@dev
ornpm install @headlessui/react@dev
.Yeah the
process
issue can’t be ours, because we don’t useprocess
inside the components 😅Here’s my
Select
component that doesn’t work:Select.tsx
I get this error (red-squiggly line) on
value
ofvalue={option}
:I even tried doing
value={option.name}
but then the select element gets removed from DOM.App.tsx
And the one that works has
const shapes = ['Circle', 'Square']
& respective changes inSelect.tsx
😃The weird thing is the one that doesn’t work in Chrome extension works in Codesandbox → https://codesandbox.io/s/headlessuireact-listbox-example-forked-lbct7?file=/src/App.js
And now the error
ReferenceError: process is not defined
is gone. It only hides the Select box entirely from the DOM after 1st selection.