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

as-wasi fails to build with v0.20.0 #2259

Closed
ColinEberhardt opened this issue Apr 11, 2022 · 3 comments
Closed

as-wasi fails to build with v0.20.0 #2259

ColinEberhardt opened this issue Apr 11, 2022 · 3 comments
Labels

Comments

@ColinEberhardt
Copy link
Contributor

This feels related to #2230 but is a little different ...

With node v16.14.2, I follow the getting started instructions, and am able to successfully build the simple example.

Following that I ...

npm i as-wasi

and change the code to ...

import "wasi"

import {Console} from "as-wasi"
Console.log("Hello World!\n");

The build now fails as follows:

% npm run asbuild

> as@1.0.0 asbuild
> npm run asbuild:debug && npm run asbuild:release


> as@1.0.0 asbuild:debug
> asc assembly/index.ts --target debug

ERROR TS6054: File '~lib/as-wasi.ts' not found.

 import {Console} from "as-wasi"
                       ~~~~~~~~~
 in assembly/index.ts(3,23)

FAILURE 1 parse error(s)

> as@1.0.0 asbuild:release
> asc assembly/index.ts --target release

ERROR TS6054: File '~lib/as-wasi.ts' not found.

 import {Console} from "as-wasi"
                       ~~~~~~~~~
 in assembly/index.ts(3,23)

FAILURE 1 parse error(s)

Rolling back to AS v0.19.x fixes the issue

@dcodeIO
Copy link
Member

dcodeIO commented Apr 11, 2022

New usage in 0.20 is: import {Console} from "as-wasi/assembly"

There is some background in the release notes. TL;DR is that assuming ./assembly/index.ts respectively following ascMain in package.json is not compatible with TS tooling respectively Node leading to all sorts of issues, so it was removed.

@dcodeIO
Copy link
Member

dcodeIO commented Apr 11, 2022

(also note that using as-wasi for console.log is no longer necessary as stdlib implements it already when import "wasi" is given)

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants