#Module '"react-hook-form"' has no exported member 'SubmitHandler'.

1 messages · Page 1 of 1 (latest)

flint thicket
#

Hello guys,
i'm having an issue with 2 libs, react-hook-form, react-chartjs-2. It shows this error:
Module '"A"' has no exported member 'B'.

This error only occurs when i use bun, it works well with nodejs.

Bun -> 1.0.35
Vite -> 5.2.6
React -> 18.2.69
react-dom -> 18.2.7
near estuary
#

It seems that you have imported the module incorrectly!

Either provide a picture of your code or refer to the documentation of these two libraries and read the documentation more carefully.

If you are using TypeScript, add the types of these two libraries to the project.

terse radish
#

as far as I know, I think bun still has some issues with React so it might also come from that

#

lacking a bit of support ! ^.^, but Mohsen is right, if you can show some code and/or open an issue for them to look at it (and if they can fix it) (if it's a bun issue) then that would be great ^.^

terse radish
#

when you hover them what does it say @flint thicket

terse radish
#

that's weird, isn't it just a TS issue think have you tried restarting ts server

#

I know it's really dumb but 🤷🏻‍♂️

#

and what if you ctrl + click on "react-hook-form" and check the exports

#

also you could try to do

#

import rhf from "react-hook-form" and do rhf.SubmitHandler and see if it works

flint thicket
humble notch
#

Can you try using latest version react-hook-form?
I was also trying to import react-datepicker and react-select and got default import issues and when I upgraded to latest version it worked somehow

#

Same issue with with rechart and @nivo and latest version fixed it

flint thicket
humble notch
#

React-chartjs-2 worked?

flint thicket
shrewd sonnet
#

Is SubmitHandler a typescript type and not at runtime? If so, can you try prefixing the value with type

import {type SubmitHandler} from “react-hook-form”
terse radish
#

I'm sure these are both functions

humble notch
humble notch
#

@flint thicket 👆

humble notch
#

I have used react-hook-form only🤷‍♂️😵‍💫

flint thicket
#

are you using vite ?

humble notch
#

You arent able to see my PR?

#

i am not using vite. Its bun