Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Client python expect some properties to be defined in the tsp config and crash if they are not #4723

Open
4 tasks done
timotheeguerin opened this issue Oct 14, 2024 · 1 comment
Assignees
Labels
bug Something isn't working emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Comments

@timotheeguerin
Copy link
Member

timotheeguerin commented Oct 14, 2024

Describe the bug

Emitter "@typespec/http-client-python" crashed! This is a bug.
Please file an issue at https://github.com/microsoft/typespec/issues

TypeError: Cannot read properties of undefined (reading 'toLowerCase')
    at addDefaultOptions (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/http-client-python/emitter/src/emitter.ts:48:43)
    at Object.$onEmit [as emitFunction] (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/http-client-python/emitter/src/emitter.ts:81:3)
    at runEmitter (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/http-client-python/node_modules/@typespec/compiler/src/core/program.ts:578:7)
    at compile (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/http-client-python/node_modules/@typespec/compiler/src/core/program.ts:252:5)
    at compileOnce (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/http-client-python/node_modules/@typespec/compiler/src/core/cli/actions/compile/compile.ts:65:21)
    at compileAction (file:///Users/timotheeguerin/dev/azsdk/typespec/packages/http-client-python/node_modules/@typespec/compiler/src/core/cli/actions/compile/compile.ts:31:5)

--------------------------------------------------
Library Version                0.3.0
TypeSpec Compiler Version      0.61.0
--------------------------------------------------
  1. It shoudln't crash
  2. It shouldn't require the properties(don't require the user to fill in tons of config to get the emitter working)

Reproduction

Run tsp compile . --emit "@typespec/http-client-python" in a simple main.tsp file without a tspconfig.yaml

Checklist

@timotheeguerin timotheeguerin added bug Something isn't working emitter:client:python Issue for the Python client emitter: @typespec/http-client-python labels Oct 14, 2024
@msyyc
Copy link
Contributor

msyyc commented Oct 15, 2024

Will take an investigation ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working emitter:client:python Issue for the Python client emitter: @typespec/http-client-python
Projects
None yet
Development

No branches or pull requests

2 participants