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

useLayoutEffect is not defined error #118

Closed
asterikx opened this issue Apr 2, 2023 · 7 comments
Closed

useLayoutEffect is not defined error #118

asterikx opened this issue Apr 2, 2023 · 7 comments

Comments

@asterikx
Copy link

asterikx commented Apr 2, 2023

After upgrading to v0.0.38, I get this error with Next.js:

Unhandled Runtime Error
ReferenceError: $jhddX$useLayoutEffect is not defined

Call Stack
eval
../node_modules/next-translate-plugin/lib/cjs/node_modules/react-resizable-panels/dist/react-resizable-panels.module.js (6:0)
../../node_modules/react-resizable-panels/dist/react-resizable-panels.module.js

v0.0.37 works just fine.

@YMNNs
Copy link

YMNNs commented Apr 2, 2023

I have the same issue on create-react-app but v0.0.37 works.

@NMinhNguyen
Copy link

NMinhNguyen commented Apr 2, 2023

Can confirm this breaks in a fresh Vite app as well (yarn create vite, yarn add react-resizable-panels, import something from the package and yarn dev to start it). I believe it's due to the 'useId'.toString() change: ed96947 (mentioned in #82 (comment)), and Parcel not handling it correctly.

@bvaughn
Copy link
Owner

bvaughn commented Apr 2, 2023

I believe it's due to the 'useId'.toString() change: ed96947

That would also be my first guess.

@NMinhNguyen
Copy link

I believe it's due to the 'useId'.toString() change: ed96947

That would also be my first guess.

Yeah, I checked out the repo and built the package a few times, and the 'useId'.toString() seems to be confusing Parcel. It seems like switching to a namespace import of React everywhere works though.

@bvaughn
Copy link
Owner

bvaughn commented Apr 2, 2023

I'm going to publish 0.0.39 with a fix for this in a few. I'm looking at other options for a few first though (beyond just reverting it).

@bvaughn
Copy link
Owner

bvaughn commented Apr 2, 2023

It seems like switching to a namespace import of React everywhere works though.

Thanks for this tip 👍🏼 I've confirmed it locally. Now I'm just adding some lint rules and stuff to make sure I don't regress.

@bvaughn
Copy link
Owner

bvaughn commented Apr 2, 2023

Should be fixed in 0.0.39

@bvaughn bvaughn closed this as completed Apr 2, 2023
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

4 participants