You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use the Menu component in one of my projects which acts as a package for another project I have. I can install the package correctly and use the component correctly. The problem comes when I am importing the package in another project. That project uses headlessui as well and functions fine. I get this error as soon as I start up my project though:
react.development.js:220 Warning: React.createElement: 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.
The code in the project being imported is simple:
<Menu>
<div>Something</div>
</Menu>
I'm aware that Menu should have more in it, but if I add Menu.Button or Menu.Items I get null pointers on Button and Items.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to use the Menu component in one of my projects which acts as a package for another project I have. I can install the package correctly and use the component correctly. The problem comes when I am importing the package in another project. That project uses headlessui as well and functions fine. I get this error as soon as I start up my project though:
The code in the project being imported is simple:
I'm aware that Menu should have more in it, but if I add
Menu.Button
orMenu.Items
I get null pointers on Button and Items.I've also seen a similar issue posted on stackoverflow:
https://stackoverflow.com/questions/73153159/components-importing-headlessui-throwing-errors-when-built-and-then-used-in-anot
I'm using react 17.0.2, tailwindcss 3.3.3, barrelsby 2.3.4, and gulp.
Beta Was this translation helpful? Give feedback.
All reactions