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

Generated typescript SDK throws "No supported protocol was found" #1104

Open
mvhenten opened this issue Dec 8, 2023 · 1 comment
Open

Generated typescript SDK throws "No supported protocol was found" #1104

mvhenten opened this issue Dec 8, 2023 · 1 comment

Comments

@mvhenten
Copy link

mvhenten commented Dec 8, 2023

Hi,

I'm trying to build a TypeScript SDK using the CLI and the example "smithy-typescript-example-client" described in this readme. However, when trying to call any of the methods on my SDK the code throws a No supported protocol was found error.

Upon inspection I can see that the generated serialise/deserialise methods have this behaviour, looking this string in this repository I can see a protocol generator has to be implemented.

I haven't been able to find any working examples for a smithy_build.json that configure such a protocol generator. Am I missing something? Various blogs and examples mention working clients using the gradle build system, is it even possible to generate a working client using the CLI alone?

Any feedback appreciated! I would love to sell the folks at my company on Smithy but so far it's been tough going.


Using smithy cli version 1.42.0 using the generated sample:

smithy init -o smithy-typescript-example-client
cd smithy-typescript-example-client/

with the modifications as mentioned in the readme.

@mvhenten
Copy link
Author

OK I found what I was missing. In the section https://github.com/smithy-lang/smithy-typescript/tree/7a8023b22bba45698793a665c02558f4e6ad3e51?tab=readme-ov-file#typescript-code-generation it is mentioned:

Note: AWS SDK for JavaScript v3, a customer of Smithy TypeScript, implements the AWS protocols and can be consumed by adding the software.amazon.smithy.typescript:smithy-aws-typescript-codegen package.

The gradle example also contains this code-gen, but the typescript-cli sample omits this. My full config had to contain these additional dependencies:

  "maven": {
    "dependencies": [
        "software.amazon.smithy:smithy-aws-traits:1.41.1",
        "software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.19.0",
        "software.amazon.smithy.typescript:smithy-typescript-codegen:0.19.0"
    ]
  },

sugmanue pushed a commit to sugmanue/smithy-typescript that referenced this issue Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant