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

Failed to execute 'createElement' #148

Open
ross-lanes opened this issue Sep 18, 2023 · 4 comments
Open

Failed to execute 'createElement' #148

ross-lanes opened this issue Sep 18, 2023 · 4 comments

Comments

@ross-lanes
Copy link

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
@Stanko
Copy link
Owner

Stanko commented Sep 19, 2023

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
Copy link
Owner

Stanko commented Sep 19, 2023

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?

@Cyclodex
Copy link

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...

@Stanko
Copy link
Owner

Stanko commented Nov 24, 2023

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?

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