bcherny/json-schema-to-typescript

Maximum call stack size exceeded

Open

#482 aperta il 11 ago 2022

Vedi su GitHub
 (3 commenti) (1 reazione) (0 assegnatari)TypeScript (449 fork)github user discovery
bughelp wanted

Metriche repository

Star
 (3302 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

When running against the CircleCI configuration schema here, https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/circleciconfig.json a max call stack size error is thrown.

This seems to be caused by the circular references on the logical definitions within the schema.

Using version 11.0.2 of json-schema-to-typescript

[
  RangeError: Maximum call stack size exceeded
      at memoized (/private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/lodash@4.17.21/node_modules/lodash/lodash.js:10612:30)
      at /private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/json-schema-to-typescript@11.0.2/node_modules/json-schema-to-typescript/dist/src/generator.js:260:81
      at Array.map (<anonymous>)
      at generateSetOperation (/private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/json-schema-to-typescript@11.0.2/node_modules/json-schema-to-typescript/dist/src/generator.js:260:30)
      at generateRawType (/private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/json-schema-to-typescript@11.0.2/node_modules/json-schema-to-typescript/dist/src/generator.js:249:20)
      at generateTypeUnmemoized (/private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/json-schema-to-typescript@11.0.2/node_modules/json-schema-to-typescript/dist/src/generator.js:143:16)
      at memoized (/private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/lodash@4.17.21/node_modules/lodash/lodash.js:10620:27)
      at /private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/json-schema-to-typescript@11.0.2/node_modules/json-schema-to-typescript/dist/src/generator.js:271:72
      at Array.map (<anonymous>)
      at generateInterface (/private/var/tmp/_bazel_matt/1074e32c37c3b3e7bc10b426cb247bb7/sandbox/darwin-sandbox/129/execroot/__main__/bazel-out/darwin_arm64-opt-exec-2B5CBBC6/bin/rosetta/src/types/circleci_dts__js_binary.sh.runfiles/__main__/node_modules/.aspect_rules_js/json-schema-to-typescript@11.0.2/node_modules/json-schema-to-typescript/dist/src/generator.js:269:14)
]

Guida contributor