Skip to content

wasm32-unknown-unknown failed to run #2754

@magodo

Description

@magodo

Bug Title

No response

Crate Name

typespec_client_core

Crate Version

0.4.0+ (rev: ec35896)

Description

First off, thanks for the amazing work for this SDK!

Recently, I have created a small client based on this SDK trying to successfully send a dummy request to Azure. It works fine when running natively. I also hope it can run in the browser, so I successfully to build it (with some tweaking about the getrandom crate).

PS: I've patched the Cargo.toml to override the dependencies on azure_core and azure_identity to revision ec358961712425cb8c688f43685f91c446249011.

When I run it, I get the following panic:

Image

The issue also occurs in the official release v0.25.0 (thankfully the build doesn't need tweaking). The error is pointing to the same crate, same module, but complaining about thread::spawn/thead:sleep is not available in wasm32.

I'd like to know if wasm32-unknown-unknown is offically supported (as I see a lot of cfg on wasm32 in this repo). I believe using wasm-bindgen is able to bridge a JS sleep for use in Rust.

Also, since the error is raised from the RetryPolicy, is there a way to allow the user to customize that policy, e.g. don't sleep or something...

Steps to Reproduce

I have a private repo to reproduce this, please let me know if you want to test it out, so I can invite you to my repo.

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.

    Type

    Projects

    Status

    Untriaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions