Azure / autorest.typescript

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.
MIT License
179 stars 75 forks source link

Failed to Generate TS Code: "Constant stream does not have a default value" #2816

Open wanlwanl opened 2 months ago

wanlwanl commented 2 months ago

Generate Result

tspconfig

spec commit id: 9583a00

Related error message

03:42:37.460 cmderr     [automation_generate.sh] ExternalError: Emitter "@azure-tools/typespec-ts" crashed! This is a bug.
03:42:37.460 cmderr     [automation_generate.sh] Please file an issue at https://github.com/Azure/autorest.typescript/issues
03:42:37.460 cmderr     [automation_generate.sh] Error: Constant stream does not have a default value
03:42:37.460 cmderr     [automation_generate.sh]     at getConstantValue (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:536:15)
03:42:37.460 cmderr     [automation_generate.sh]     at getParameterMap (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:475:16)
03:42:37.461 cmderr     [automation_generate.sh]     at getRequestParameters (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:331:27)
03:42:37.461 cmderr     [automation_generate.sh]     at getSendPrivateFunction (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:29:179)
03:42:37.461 cmderr     [automation_generate.sh]     at file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/buildOperations.js:47:46
03:42:37.461 cmderr     [automation_generate.sh]     at Array.forEach (<anonymous>)
03:42:37.461 cmderr     [automation_generate.sh]     at buildOperationFiles (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/buildOperations.js:45:35)
03:42:37.461 cmderr     [automation_generate.sh]     at generateModularSources (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/index.js:170:13)
03:42:37.462 cmderr     [automation_generate.sh]     at Object.$onEmit [as emitFunction] (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/index.js:78:15)
03:42:37.462 cmderr     [automation_generate.sh]     at async runEmitter (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@typespec/compiler/dist/src/core/program.js:452:13)
03:42:37.462 cmderr     [automation_generate.sh] --------------------------------------------------
03:42:37.462 cmderr     [automation_generate.sh] Library Version                0.33.0
03:42:37.462 cmderr     [automation_generate.sh] TypeSpec Compiler Version      0.59.1
03:42:37.462 cmderr     [automation_generate.sh] --------------------------------------------------
03:42:37.462 cmderr     [automation_generate.sh]     at runEmitter (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@typespec/compiler/dist/src/core/program.js:455:19)
03:42:37.463 cmderr     [automation_generate.sh]     at async compile (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@typespec/compiler/dist/src/core/program.js:132:9)
03:42:37.463 cmderr     [automation_generate.sh]     at async compileTsp (file:///opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/typespec.js:88:21)
03:42:37.463 cmderr     [automation_generate.sh]     at async generateCommand (file:///opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/commands.js:238:21)
03:42:37.463 cmderr     [automation_generate.sh]     at async initCommand (file:///opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/commands.js:119:9)
03:42:37.463 cmderr     [automation_generate.sh]     at async Object.handler (file:///opt/hostedtoolcache/node/18.20.4/x64/lib/node_modules/@azure-tools/typespec-client-generator-cli/dist/index.js:98:5) {
03:42:37.463 cmderr     [automation_generate.sh]   info: {
03:42:37.463 cmderr     [automation_generate.sh]     kind: 'emitter',
03:42:37.463 cmderr     [automation_generate.sh]     metadata: {
03:42:37.464 cmderr     [automation_generate.sh]       type: 'module',
03:42:37.464 cmderr     [automation_generate.sh]       name: '@azure-tools/typespec-ts',
03:42:37.464 cmderr     [automation_generate.sh]       homepage: 'https://github.com/Azure/autorest.typescript/tree/main/packages/typespec-ts/',
03:42:37.464 cmderr     [automation_generate.sh]       bugs: [Object],
03:42:37.464 cmderr     [automation_generate.sh]       version: '0.33.0'
03:42:37.465 cmderr     [automation_generate.sh]     },
03:42:37.465 cmderr     [automation_generate.sh]     error: Error: Constant stream does not have a default value
03:42:37.465 cmderr     [automation_generate.sh]         at getConstantValue (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:536:15)
03:42:37.465 cmderr     [automation_generate.sh]         at getParameterMap (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:475:16)
03:42:37.465 cmderr     [automation_generate.sh]         at getRequestParameters (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:331:27)
03:42:37.465 cmderr     [automation_generate.sh]         at getSendPrivateFunction (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/helpers/operationHelpers.js:29:179)
03:42:37.466 cmderr     [automation_generate.sh]         at file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/buildOperations.js:47:46
03:42:37.466 cmderr     [automation_generate.sh]         at Array.forEach (<anonymous>)
03:42:37.466 cmderr     [automation_generate.sh]         at buildOperationFiles (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/modular/buildOperations.js:45:35)
03:42:37.466 cmderr     [automation_generate.sh]         at generateModularSources (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/index.js:170:13)
03:42:37.466 cmderr     [automation_generate.sh]         at Object.$onEmit [as emitFunction] (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@azure-tools/typespec-ts/dist/src/index.js:78:15)
03:42:37.466 cmderr     [automation_generate.sh]         at async runEmitter (file:///mnt/vss/_work/1/s/azure-sdk-for-js/sdk/machinelearning/ai-chat-protocol/TempTypeSpecFiles/node_modules/@typespec/compiler/dist/src/core/program.js:452:13)
03:42:37.466 cmderr     [automation_generate.sh]   }
03:42:37.466 cmderr     [automation_generate.sh] }