boringdesigners / boring-avatars

Boring avatars is an open source React library that generates custom, SVG-based avatars from any username and color palette.
https://boringavatars.com
MIT License
5.7k stars 200 forks source link

`Element type is invalid` error in latest Remix.run project #76

Closed kishanhitk closed 5 months ago

kishanhitk commented 9 months ago

Describe the bug The Avatar component is not working in latest Remix.run project. Getting this error

To Reproduce Steps to reproduce the behavior:

  1. Create a new Remix app
  2. Install the library
  3. Add the default Avatar component.
  4. See error

Expected behavior It should render the avatar

Screenshots image

Desktop (please complete the following information):

Additional context I even tried making the component client side only, and skipping the render of it during SSR, still getting the issue.

macklinu commented 8 months ago

I ran into the same issue, so I opened https://github.com/boringdesigners/boring-avatars/pull/78 as a potential solution.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

macklinu commented 7 months ago

Not stale

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

jtanguy commented 5 months ago

I have managed to make the import work without re-bundling this library. I added a check to use the default export

import Boring from "boring-avatars";

const RealBoring = typeof Boring.default !== "undefined" ? Boring.default : Boring
// Then use RealBoring as you would use Boring