Service with "<UNKNOWN_IDENTIFIER>" identifier was not found in the container. #978
Unanswered
RyannGalea
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I bet this is an issue with your weird TS-babel-esnext-es2015 transpile chain, so it treat arrow function as normal function with prototype, thus detecting it as a class and tries to get the instance from container. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Previously when I was developing with ts-node-dev, I had little issues but now I've put together a build system to get my code to a production build I'm having some issues.
Consider that my code is written in Typescript and then uses Babel to transpile from Typescript to esnext, it then transpiles again down to es2015.
I never had an issue before but now I'm having this error for my HasRole middleware, and I have no direction on why this would now be an issue.
Firstly is there a way to remedy this directly? This would be the easiest to keep the code as-is. Obviously, I can create class-based middleware but I'm not sure why I should only have to now, is this a TypeDI issue?
I already had to turn my global middleware into a class middleware so I could then decorate it with @service but here it's a little bit harder because I'd like to just send the roles to the middleware directly, which is why I'm here asking for help on this.
The only way I can see doing it is creating class middleware which then has all the roles for each mutation in another service I can inject but I'd prefer to not go that direction.
Any guidance or help is appreciated.
Ryann,
Beta Was this translation helpful? Give feedback.
All reactions