react-spring-bottom-sheet icon indicating copy to clipboard operation
react-spring-bottom-sheet copied to clipboard

TypeError: Cannot read properties of undefined (reading 'getValue')

Open bilalkocak opened this issue 3 years ago • 36 comments

I'm using your great module on my all projects but i couldn't implement to new one.

I got this error when "open state" to true. -> "TypeError: Cannot read properties of undefined (reading 'getValue')"

my dependencies: "react-spring-bottom-sheet": "^3.4.0", "next": "12.1.4", "react-dom": "18.0.0",

Code:

 const [open, setOpen] = useState(false)
    return (
        <>
            <button onClick={() => setOpen(true)}>Open</button>
            <BottomSheet open={open}>My awesome content here</BottomSheet>
        </>
    )
image

bilalkocak avatar Apr 13 '22 08:04 bilalkocak

Ran into the same issue, looks like it's a issue with React v18 StrictMode, removing StrictMode or running a prod build it works fine. https://reactjs.org/blog/2022/03/29/react-v18.html#new-strict-mode-behaviors

howlettt avatar Apr 14 '22 20:04 howlettt

Looks like react-spring doesn't support React v18 yet https://github.com/pmndrs/react-spring/issues/1563

howlettt avatar Apr 14 '22 20:04 howlettt

I've launched a beta for react18 that should resolve issues and be good to go – 9.4.5-beta.1 please feel free to give it a go and any issue feedback on that issue you linked too :)

joshuaellis avatar Apr 14 '22 21:04 joshuaellis

How i do access the beta version?

ivanoliveiraitez avatar May 13 '22 11:05 ivanoliveiraitez

I would like to try the beta also, where can I download it? thanks

alexchavero avatar May 19 '22 17:05 alexchavero

I actually launched a new version of react-spring that works with r18, so I think this project would need to update its deps accordingly 👌🏻 9.4.5 for reference.

joshuaellis avatar May 19 '22 17:05 joshuaellis

Thanks joshuaellis, I uninstalled the react-spring-bottom-sheet package and re-installed it. Then checked the react-spring version and is now the 9.4.5 you mentioned; but I still getting the same error: TypeError: Cannot read properties of undefined (reading 'getValue'). The error is in the localhost only, in production works fine.

Did I missed something else that you can help me please?

alexchavero avatar May 19 '22 18:05 alexchavero

Well the package here is locked to version 8 API, so it probably needs a good update to be working with react18 & react-spring9

Id try talk to the maintainer or update the lib and submit a PR.

joshuaellis avatar May 19 '22 18:05 joshuaellis

Have same while migrated from react to nextjs, react 18.2.0, but was working fine with 17

maxizhukov avatar Jun 22 '22 12:06 maxizhukov

@joshuaellis I have gone ahead and made the changes needed to upgrade to react-spring v9.4.5

AshMW2724 avatar Jun 23 '22 12:06 AshMW2724

I still have the issue with the last version, any ideas ?

SebastienSusini avatar Jul 06 '22 13:07 SebastienSusini

Same here, latest version (3.4.1) on react 18 still triggers the same issue. Running on NextJS if that helps

klanthier avatar Jul 14 '22 17:07 klanthier

I'm having the same issue as well. Let me know if there is anything I can do to help resolve it.

treyhuffine avatar Jul 30 '22 00:07 treyhuffine

It seems to be working in 3.5.0-alpha.0

OskarD avatar Aug 16 '22 12:08 OskarD

Please has a solution to this been discovered? I'm having the same issue now

odafeaggreh avatar Oct 06 '22 14:10 odafeaggreh

the issue is still there "react": "^18.2.0", "react-dom": "^18.2.0", "react-spring-bottom-sheet": "3.5.0-alpha.0"

mard0n avatar Oct 17 '22 11:10 mard0n

the issue is still there "react": "^18.2.0", "react-dom": "^18.2.0", "react-spring-bottom-sheet": "3.5.0-alpha.0"

it's working fine on me, maybe try to remove the node_modules folder then run npm install again?

my package.json "react": "18.2.0", "react-dom": "18.2.0", "react-spring-bottom-sheet": "3.5.0-alpha.0",

novaladip avatar Oct 18 '22 00:10 novaladip

I have the same issue. It's also working in version 3.5.0-alpha.0. Why not release the original version?

nazaninroozbahani avatar Nov 11 '22 17:11 nazaninroozbahani

Same issue here

unmanned-harry avatar Dec 07 '22 02:12 unmanned-harry

:up:

precz avatar Dec 17 '22 20:12 precz

I got the same problem.

My dependencies:

"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-spring-bottom-sheet": "^3.4.1"

nadiannis avatar Mar 04 '23 07:03 nadiannis

I got the same error with:

"react": "18.2.0",
"react-dom": "18.2.0",
"react-spring-bottom-sheet": "^3.4.1".

I am looking for other options to do the same, instead I´ll try to use this: https://www.npmjs.com/package/react-modal-sheet

I would appreciate if other people have more options.

ramirez411 avatar Mar 07 '23 16:03 ramirez411

Haven't tried it yet, but this seems similar https://github.com/roman-rr/cupertino-pane

howlettt avatar Mar 08 '23 03:03 howlettt

Haven't tried it yet, but this seems similar https://github.com/roman-rr/cupertino-pane

Thanks

ramirez411 avatar Mar 15 '23 21:03 ramirez411

Haven't tried it yet, but this seems similar https://github.com/roman-rr/cupertino-pane

Very nice animations, but I unfortunately couldn't figure out how to use it with JSX

joaolfern avatar Jun 19 '23 16:06 joaolfern

I would like to use this package, but unfortunately it doesn’t work...

"next": "13.4.5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-spring-bottom-sheet": "^3.4.1" | "3.5.0-alpha.0" 

kiki-le-singe avatar Jun 23 '23 10:06 kiki-le-singe

it worked by disabling the react strict mode on nextjs 13.

AyushSaini00 avatar Aug 01 '23 06:08 AyushSaini00

Haven't tried it yet, but this seems similar https://github.com/roman-rr/cupertino-pane

Very nice animations, but I unfortunately couldn't figure out how to use it with JSX

https://github.com/tech-systems/panes/issues/142#issuecomment-816086262

howlettt avatar Aug 21 '23 21:08 howlettt

i guess still no solution for this issue i'm having this issue as well on nextjs 13

kthehatter avatar Nov 07 '23 12:11 kthehatter

⬆️ Same issue here, any updates on that?

Franjoo avatar Nov 08 '23 11:11 Franjoo