CKGrafico / inversify-props

Wrapper of Inversify to inject your dependencies in the components, made with TypeScript and compatible with Vue, React and other component libraries.
MIT License
85 stars 9 forks source link

Error: No matching bindings found for serviceIdentifier: Symbol() #25

Closed DoDoSt closed 4 years ago

DoDoSt commented 4 years ago

In production build I get the following error with injecting a service in a Vue component vue.runtime.esm.js:1888 Error: No matching bindings found for serviceIdentifier: Symbol(TestService).

In dev build everything works.

Production build with: vue-cli-service build

Dev build with: vue-cli-service serve or vue-cli-service build --mode development

I made a simple project to show my issue:

TestVueProject.zip

CKGrafico commented 4 years ago

Hello probably this will help https://github.com/CKGrafico/inversify-props#how-to-configure-uglify-or-terser

DoDoSt commented 4 years ago

Good idea! I didn't think about that the class names would be changed during productive construction. Thanks for the hint.

CKGrafico commented 4 years ago

Sorry probably is not well documented, I accept suggestions

NavidMitchell commented 3 years ago

I am having this problem after upgrading to 2.2.6 from 1.4.9. It seems to only happen if I inject more than one dependency into a vue component. If I down grade to 1.4.9 everything works as expected.

CKGrafico commented 3 years ago

Are you decorating your classes with @injectable? because is not required anymore

NavidMitchell commented 3 years ago

I was initially but I saw the other issue about that so I removed injectable from all of my classes and still was getting the same error.

CKGrafico commented 3 years ago

Can you share a sandbox to reproduce?