Skip to content

Explore WebAssembly support #667

@brandonros

Description

@brandonros

I don't know why I expected this to work with WebAssembly (it compiles for the wasm32-unknown-unknown target if you disable any TLS/SSL features).

But you will get to JavaScript layer and have one of what I guess is many issues (how would it know to do HTTP over fetch()?):

panicked at 'time not implemented on this platform', library/std/src/sys/wasm/../unsupported/time.rs:13:9

Stack:

Error
    at http://localhost:8080/pkg/graphql_poc.js:188:21

Which comes from

 let agent = AgentBuilder::new()
        .timeout_read(Duration::from_secs(30))
        .timeout_write(Duration::from_secs(30))
        .build();

I read you can use Chrono::Duration (which does support WASM) but AgentBuilder would need to accept non std::time::Duration?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions