File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,12 +48,17 @@ export const UNKNOWN_DEPENDENCIES_MESSAGE = (
4848
4949 let message = `\nNest can't resolve dependencies of the ${ type . toString ( ) } ` ;
5050
51- if ( isNil ( index ) ) {
52- message += `.\nPlease make sure that the "${ key . toString ( ) } " property is available in the current context.
53-
51+ const potentialSolutions = `\n
5452Potential solutions:
5553- If ${ name } is a provider, is it part of the current ${ moduleName } ?
54+ - If ${ name } is exported from a separate @Module, is that module imported within ${ moduleName } ?
55+ @Module({
56+ imports: [ /* the Module containing ${ name } */ ]
57+ })
5658` ;
59+
60+ if ( isNil ( index ) ) {
61+ message += `.\nPlease make sure that the "${ key . toString ( ) } " property is available in the current context.${ potentialSolutions } ` ;
5762 return message ;
5863 }
5964 const dependenciesName = ( dependencies || [ ] ) . map ( getDependencyName ) ;
@@ -63,15 +68,8 @@ Potential solutions:
6368 message += dependenciesName . join ( ', ' ) ;
6469 message += `). \nPlease make sure that the argument ${ name } at index [${ index } ] is available in the ${ getModuleName (
6570 module ,
66- ) } context.
67-
68- Potential solutions:
69- - If ${ name } is a provider, is it part of the current ${ moduleName } ?
70- - If ${ name } is exported from a separate @Module, is that module imported within ${ moduleName } ?
71- @Module({
72- imports: [ /* the Module containing ${ name } */ ]
73- })
74- ` ;
71+ ) } context.`
72+ message += potentialSolutions ;
7573
7674 return message ;
7775} ;
You can’t perform that action at this time.
0 commit comments