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

React Animate Height Failed to compile with version 3 #129

Closed
TrizBea24 opened this issue Jun 18, 2022 · 2 comments
Closed

React Animate Height Failed to compile with version 3 #129

TrizBea24 opened this issue Jun 18, 2022 · 2 comments

Comments

@TrizBea24
Copy link

With the node version v16.14.0, the React version "16.13.1" and the react-animate-height" version "^3.0.3", I get the next issue:
Failed to compile.

./node_modules/react-animate-height/dist/esm/index.js 17:32 Module parse failed: Unexpected token (17:32) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders | // Check for element?.style is added cause this would fail in tests (react-test-renderer) | // Read more here: #17

if (height === 0 && element?.style) {
| element.style.display = 'none'; | }

It is solved changing the version of react-animate-height to "^2.0.1".

@Stanko
Copy link
Owner

Stanko commented Jun 19, 2022

Hello there,
I think I know what is going on, and I've released version 3.0.4, so please try that.

And please try to provide even more data when opening an issue (which tools are you using, is it a client, or server build...), it makes it much easier to pinpoint bugs like this. Thank you!

Cheers!

EDIT: The problem was that target in my tsconfig was set to esnext, I swapped it for es6: edac80d

@TrizBea24
Copy link
Author

Oh great! I just tried version 3.0.4 and It worked perfectly. Many thanks!

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

2 participants