-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
npx ezno check
does not check code?
#204
Comments
Building with cargo and running does produce the expected output, so it seems this is a problem with the npm package itself. $ /Users/dan/Source/ezno/target/debug/ezno check ./file.ts
error:
┌─ file.ts:1:19
│
1 │ const k: number = "abc"
│ ------ ^^^^^ Type "abc" is not assignable to type number
│ │
│ Variable declared with type number
|
I don't know how to debug this. I get as far as this call:
where And after that, it steps into wasm code, which I don't know how to debug. |
npx ezno check
does not check code?
Hmm yes maybe a problem with the I presume NPM and related is a nightmare for packaging platform specific code and binaries 😡 |
As show above, Additionally, even running this module with deno exits silently:
Or via npm imports, also exits silently:
I bet! If you know a way to get sourcemaps working so that I can step into the Rust code, that would certainly help! |
Sorry misread the last message. Ah that is good Looking at the code: I think it is maybe due to the glob support for checking files, which has been added since the last release. Line 215 in cd8e961
If you add a similar I don't know if you can do WASM source maps? rustwasm/wasm-pack#824 |
Indeed the glob support is the cause of failure. Lines 467 to 469 in cd8e961
|
Okay I think I'm starting to understand Rust, WASM, and wasm-pack. In particular, just about any sort of system call is going to fail. If filesystem access and stdio is needed, it seems prudent to use wasi for this.
|
Yep WASM by itself just implements standard instructions. WASI adds more functions for handling system things etc. However with just base WASM you can import functions in two ways. Either with an Lines 4 to 8 in cd8e961
Or using Lines 84 to 85 in cd8e961
and this is how the CLI works Lines 125 to 140 in cd8e961
Having another look at the CLI and especially the glob as input support it uses Lines 457 to 479 in cd8e961
and unfortunately the rustc WASM build (which wasm-pack wraps) just compiles Changing the |
My impression is that you either inject the effectful code you need as JS callbacks (which is what you’ve done with I believe that:
Footnotes |
I'm trying to get started with
ezno
andnpx ezno check file.ts
does not print anything and exits with code 0.I'm using ezno@0.0.22 installed via npm on Mac OS.
The text was updated successfully, but these errors were encountered: