TypeError: Converting circular structure to JSON

Aperta
#116 20 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
express, node.js, typescript
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
689
Fork
97
Merge medio
2h 36m
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di openapistack/openapi-backend

Tutte le issue di openapistack/openapi-backend

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.