TypeError: Converting circular structure to JSON

Abierto
#116 20 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
express, node.js, typescript
Área
backend

Línea de trabajo

The report reproduces the error in the express-ts-mock example at examples/express-ts-mock/index.ts while using a YAML file, and the stack trace points to fast-json-stable-stringify. Start by comparing the YAML mock input with the example's request flow and inspect the comments for further diagnosis. Done means identifying and documenting or fixing the cause of the circular value during serialization; the issue has had no recent activity.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

I'm trying to use a YAML file to create a mock.
I'm using example "express-ts-mock" (https://github.com/anttiviljami/openapi-backend/blob/master/examples/express-ts-mock/index.ts)

but this is the result...

snakuzzo@laptop:~/workspace/openapi-backend/examples/express-ts-mock$ npm start

> [email protected] start /home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock
> node dist/index.js

api listening at http://localhost:9000
(node:90915) UnhandledPromiseRejectionWarning: TypeError: Converting circular structure to JSON
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:42:19)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
    at stringify (/home/snakuzzo/workspace/openapi-backend/examples/express-ts-mock/node_modules/fast-json-stable-stringify/index.js:50:25)
(node:90915) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:90915) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Any suggestion?

Thanks

Lenguaje dominante
TypeScript
Estrellas
689
Forks
97
Merge medio
2 h 36 min
PR fusionados (30 d)
11

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openapistack/openapi-backend

Todos los issues de openapistack/openapi-backend

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.