Open jbrighton-dev opened 2 years ago
@JoeBrighton If you are using babel within webpack, make sure to have it configured to work with tsyringe . https://github.com/microsoft/tsyringe#babel
I was facing the same error with @autoInjectable
in a blank TS project. Configuring babel fixed the issue for me.
Describe the bug
@autoInjectable doesn't work with Create React App.
To Reproduce
Expected behavior
I'm sure there's an issue surrounding the way webpack is processing these file, but without ejecting the app, is this possible? We also want to avoid using the container.resolve() syntax. If its possible to get instances of classes from the container in tsx files without either container.resolve() or autoinjectable, then shout.
Version: