While upgrading a sizable Nest 5 application to version, I get this error:
TypeError: metatype is not a constructor
Thrown in line 274 at injector.js, all i can get from debugging is that is seems to be an anonymous function:
(...args) => {
let n = args[0] || defaultKey;
if (n in cache) {
return cache[n];
}
else {
let result = fn(n === defaultKey ? undefined : n);
cache[n] = result;
return result;
}
}
Works in v5, not in v6
To either work or give some indication of what / why / where the problem exists. I get no context at all.
Nest version: 5.4.0 -> 6.3.1
For Tooling issues:
- Node version: 10
- Platform: Linux
Others:
The problem was @UseGuards(AuthGuard)
at one point in my code, which should have been @UseGuards(AuthGuard('bearer'))
I really wish the injector could give a little more context and not just the standard js error.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
The problem was
@UseGuards(AuthGuard)
at one point in my code, which should have been@UseGuards(AuthGuard('bearer'))
I really wish the injector could give a little more context and not just the standard js error.