[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[Nest] 2998 - 2018-5-13 19:41:01 [ExceptionHandler] Converting circular structure to JSON
TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at ModuleTokenFactory.getDynamicMetadataToken (/home/nest/uroboros/node_modules/@nestjs/core/injector/module-token-factory.js:16:45)
at ModuleTokenFactory.create (/home/nest/uroboros/node_modules/@nestjs/core/injector/module-token-factory.js:10:27)
at ModuleCompiler.compile (/home/nest/uroboros/node_modules/@nestjs/core/injector/compiler.js:19:47)
at NestContainer.addModule (/home/nest/uroboros/node_modules/@nestjs/core/injector/container.js:31:70)
at DependenciesScanner.storeModule (/home/nest/uroboros/node_modules/@nestjs/core/scanner.js:32:24)
at DependenciesScanner.scanForModules (/home/nest/uroboros/node_modules/@nestjs/core/scanner.js:22:14)
at modules.map.innerModule (/home/nest/uroboros/node_modules/@nestjs/core/scanner.js:25:18)
at Array.map (<anonymous>)
at DependenciesScanner.scanForModules (/home/nest/uroboros/node_modules/@nestjs/core/scanner.js:24:17)
Nest application successfully started
import { DynamicModule, Module } from '@nestjs/common';
@Module({})
export class UroburosModule {
static forRoot(): DynamicModule {
let oyra = {bora:{}};
const UroburosProvider = {
name: 'UROBUROS_PROVIDER',
provide: 'UROBUROS_PROVIDER',
useValue: oyra.bora = oyra
};
return {
module: UroburosModule,
providers: [UroburosProvider],
exports: [UroburosProvider]
};
}
}
Allow use of external libraries that contain circular references
Nest version: 5.0.0
For Tooling issues:
- Node version: 10.0.0
- Platform: Linux
Thanks @cdiaz, I'm on it
Fixed in v5.0.1
Currently trying to upgrade my Nest 4.x.x application to 5.3.10.
My application does have a circular dynamic module and works perfectly fine with 4.x.x, but I'm having the error message TypeError: Converting circular structure to JSON
Looking through your commit history, the commit which fixed this issue is more or less reverted by commit ce498e86150f7de4a260f0c393d47ec4cc920ea1.
Why is this? Can not find any statement on this.
@kamilmysliwiec Please, reopen this issue, Apparently this commit in which changes are reverted, has reopened the problem
Solved by #1142, I'll merge it soon
Published as 5.3.11
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.