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

Storybook error: Element type is invalid: expected a string or a class/function but got: undefined. #44

Open
spsaucier opened this issue Dec 29, 2023 · 3 comments

Comments

@spsaucier
Copy link

I'm trying to include Phosphor in a design system displayed in Storybook (web), but I'm getting this error whenever I include Phosphor icon:

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.

Has anyone else gotten this working in Storybook? Is there some change I should be making to .storybook/main.js to work with phosphor-react-native?

@spsaucier
Copy link
Author

For a temporary resolution, I've ended up installing @phosphor-icons/react and adding this to my .storybook/main.js addon options for @storybook/addon-react-native-web:

modulesToAlias: {
  'phosphor-react-native': '@phosphor-icons/react',
},

Downsides: The React web icons are not the same size as the RN ones.

@ChrisCoder9000
Copy link

I'm having this issue while creating a web static project with expo

@rodrix
Copy link

rodrix commented May 29, 2024

Same here. Not working on Storybook. =/

image

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

3 participants