#Vite + Inversify + Typescript

2 messages · Page 1 of 1 (latest)

gray raft
#

I have a project that is currently built using create-react-app and I want to migrate it to Vite. It mostly works, however I'm completely stuck on making Inversify work. I constantly get this error message for every injectable dependency: Uncaught Error: Missing required @injectable annotation in: <insert service name here>

I have imported "reflect-metadata" everywhere, I have decorators and metadata turned on in TSConfig, but nothing seems to help, I'm at my wits end. Has anyone else made this work?

I have a suspicion that ESBuild might be handling decorators differently (if at all) then Babel

slim pelican
#

have you solved this yet? you should know at this point that Vite does not use Babel. IDK about Inversify but it looks not well maintained. Is the extra complexity of dependency injection really worth it? For me, in js/ts it never seemed necessary....