Skip to content

ESM Module problem #33

@qarlosalberto

Description

@qarlosalberto

I'm trying to use @yowasp/yosys npm package directly in a VSCode extension, but I'm encountering some difficulties. @yowasp/yosys uses "type": "module",, but VSCode haven't a good support for ES Modules.

I'm having problems importing @yowasp/yosys with my commonjs extension. Also I have tried:

async function getYosys(): Promise<any> {
    const yosys = await (eval(`import('@yowasp/yosys')`) as Promise<typeof import('@yowasp/yosys')>);
    return yosys;
}

export async function showYosysVersion() {
    const yosys = await getYosys();
    await yosys.runYosys(["--version"]);
}

But there are some errors related to WebAssembly. Could be possible to publish the package with commonjs instead of ESM Module?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions