Nest: UnknownDependenciesException fails to render error message for a symbol DI token

Created on 13 Feb 2019  路  3Comments  路  Source: nestjs/nest

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

When I use symbols as DI tokens and UnknownDependenciesException happens then I get an error:

[Nest] 31114   - 2019-2-13 17:08:35   [ExceptionHandler] Cannot convert a Symbol value to a string +1ms
TypeError: Cannot convert a Symbol value to a string
    at Object.exports.UNKNOWN_DEPENDENCIES_MESSAGE (/home/user/project/node_modules/@nestjs/core/errors/messages.js:25:61)

Expected behavior

A sane error message like this

[Nest] 1018   - 2019-2-13 17:21:56   [ExceptionHandler] Nest can't resolve dependencies of the Symbol(di-token) (?). Please make sure that the argument at index [0] is available in the ServicesModule context. +0ms

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Nest version: 5.5.0


For Tooling issues:
- Node version: v8.12.0
- Platform:  Linux

Others:

core type todo 馃挌

Most helpful comment

I came across this while developing om 6.0.0 but haven鈥檛 had the time to fix ir. I can look into it this weekend, should be easy fix. Would you mind assigning me @kamilmysliwiec ? 馃槃

All 3 comments

I came across this while developing om 6.0.0 but haven鈥檛 had the time to fix ir. I can look into it this weekend, should be easy fix. Would you mind assigning me @kamilmysliwiec ? 馃槃

5.7.3 has been published.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

artaommahe picture artaommahe  路  3Comments

rlesniak picture rlesniak  路  3Comments

yanshuf0 picture yanshuf0  路  3Comments

anyx picture anyx  路  3Comments

janckerchen picture janckerchen  路  3Comments