question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I generate a valid WASM file

See original GitHub issue

We need c++14 here but there is no way to pass --std=c++14 to emcc used by tree-sitter build-wasm The Makefile mentions a patched version of web-tree-sitter I’ve tried it but does not solve the issue;

When I use the generated WASM file (with npx tree-sitter build-wasm) I get:

bad export type for `_ZNSt3__25ctypeIcE2idE`: undefined

I think that is related to build-wasm not building with c++14 so how was it done here? (Makefile does not specify c++14)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
wenkokkecommented, Jan 7, 2022

Yes, compile web-tree-sitter with the —debug flag.

1reaction
414owencommented, Jan 6, 2022

@FoamScience I ran your setup in a debugger, and this is where the error occured.

Screenshot from 2022-01-06 15-45-20

I’ve gone into the surrounding code and I’m 80% this will be fixed by adding memset in the same way as this pr.

There was a point at which it was looking up memset in a dict of the symbols we’ve marked as exported.

Why exactly it manifests in this way, I have no idea…

@wenkokke did you have to do anything special to get the nice undefined symbol errors?

edit I guess it’s slightly different, it can’t find memset, rather than _memset

Read more comments on GitHub >

github_iconTop Results From Across the Web

WebAssembly.validate() - MDN Web Docs
The WebAssembly.validate() function validates a given typed array of WebAssembly binary code, returning whether the bytes form a valid wasm ...
Read more >
WebAssembly - Validation - Tutorialspoint
Let us try one example. Go to Wasm fiddler, which is available at https://wasdk.github.io/WasmFiddle/, enter C code of your choice and down the...
Read more >
WASM Tutorial - Marco Selvatici
Once Emscripten is installed, we are ready to create our first WASM app! ... With your previous terminal, move in to the new...
Read more >
Build your own WebAssembly Compiler - Scott Logic Blog
These eight bytes form valid WebAssembly (or wasm) module. More typically these would be delivered to the browser as a .wasm file.
Read more >
Questions about wasm files generation · Issue #3422 - GitHub
Hi, we are using opa build to generate wasm files. ... Is it true that only one wasm file is needed for all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found