Use headlessui/react in Turborepo Packages #3203
Unanswered
roshanjayathunga
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
I'm encountering an issue when using the @headlessui/react library in turborepo packages. I created a UI package with react, tailwindcss, and headlessui as dependencies. When I export and use my custom component inside my main React app, I receive the following runtime error:
Uncaught runtime errors:
×
_ERROR
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of
HeadlessComponent
.Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports._
Dependency Versions:
react: ^18.2.0
@headlessui/react: ^1.7.14
Component Code:
import React, { useState } from 'react';
import { Dialog } from '@headlessui/react';
export default function HeadlessComponent() {
let [isOpen, setIsOpen] = useState(true);
}
Code in main app
export default App;
Additional Information:
I have verified that the component is correctly exported and imported.
Reinstalling dependencies did not resolve the issue.
Appreciate your solutions for this!
Beta Was this translation helpful? Give feedback.
All reactions