Skip to content

Using Http Plugin: Duplicated Http Namespace #1376

@dOrgJelli

Description

@dOrgJelli

Describe the bug
The "Http" namespace gets duplicated when using the Http plugin in your wrapper's build.

Please provide the steps to reproduce and if possible a minimal demo of the problem.
Repro steps:

  1. Create a new wasm project with CLI version >0.9.0:
    polywrap create wasm rust test-wrapper
  2. Import the Http module into your wrapper like so:
    #import { Module } into Http from "ens/http.polywrap.eth"
    
  3. Run polywrap codegen to generate types.
  4. Look at generated types, the Http namespace is duplicated, leading to Http_Http_Module in languages like wasm/assemblyscript, and HttpHttpModule in wasm/rust.

Expected behavior
Http namespace should only repeat once, for example HttpModule.

Relevant environment details:

  • Toolchain: 0.9.3

Additional context
This is happening because the Http plugin implements the Http interface. You can "fix" the problem by adding @polywrap/http-interface as an npm dependency, installing it, and adding this to your polywrap.yaml manifest:

source:
  ...
  import_abis:
    - uri: "ens/http.polywrap.eth"
      abi: ./node_modules/@polywrap/http-interface/build/wrap.info

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions