react-animate-height icon indicating copy to clipboard operation
react-animate-height copied to clipboard

Failed to execute 'createElement'

Open ross-lanes opened this issue 2 years ago • 4 comments

It looks like the default export for the ems is not a string and not the component object as of v3.2.2/3.2.1 to resolve reverted to 3.2.0

Expected behavior import AnimateHeight from 'react-animate-height'; results in AnimateHeight being a react component

current behavior import AnimateHeight from 'react-animate-height'; results in AnimateHeight being the string (ex: '/static/media/index.c7618d05.cjs'

This results in the error

InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('/static/media/index.c7618d05.cjs') is not a valid name.

Possible Solution I have no clue why this is happening

Steps to Reproduce (for bugs) create an application using v3.2.2 that compiles using vite.JS or react-scripts and renders an AnimateHeight component

Your Environment

  • Version used: v3.2.2 and v3.2.1
  • OS: windows/Linux
  • Browser chrome, edge, and safari
  • Version latest as of poast

ross-lanes avatar Sep 18 '23 17:09 ross-lanes

Hey @Bestadd, Thank you for the detailed report. These exports are going to be the end of me 🙈 I'm in a very busy project atm, but I'll make sure to tackle this by the end of the week. Cheers!

Stanko avatar Sep 19 '23 10:09 Stanko

Hey, I can't replicate this. I tried it locally and on StackBlitz and imports work fine.

Vite: https://stackblitz.com/edit/vitejs-vite-avkgx3?file=src%2FApp.tsx

react-scripts: https://stackblitz.com/edit/react-starter-69nigk?file=package.json%2CHello.js

Any idea how to replicate it?

Stanko avatar Sep 19 '23 11:09 Stanko

Hey, I just had the same issue, when trying out this lib. However I could manually fix it with importing directly the esm version:

import AnimateHeight, { Height } from 'react-animate-height/dist/esm/index';

Could also not yet reproduce it on stackblitz :( Running on react 16.13 but this seems not to be the issue Also putting the tsconfig.json into it, didn't made stackblitz fail...

Cyclodex avatar Nov 23 '23 21:11 Cyclodex

Hey, it would be awesome if we can figure out the way to reproduce it, I can't make it happen on my machine. Any ideas?

Stanko avatar Nov 24 '23 10:11 Stanko