Skip to content

bug fix for wat2wasm demo to remove call to module.resolveNames#2726

Merged
sbc100 merged 1 commit into
WebAssembly:mainfrom
yuvraj-sahu:bugfix_demo_resolve_names
Mar 24, 2026
Merged

bug fix for wat2wasm demo to remove call to module.resolveNames#2726
sbc100 merged 1 commit into
WebAssembly:mainfrom
yuvraj-sahu:bugfix_demo_resolve_names

Conversation

@yuvraj-sahu

Copy link
Copy Markdown
Contributor

On the wat2wasm demo website, when correct WAT is written (such as with any of the examples), the build log displays the following error: TypeError: module.resolveNames is not a function. This error seems to originate from the JavaScript file demo.js, which contains module.resolveNames() on line 110. This prevents WebAssembly from being generated.

At commit d8e3fe6, the resolveNames function existed within libwabt.js as an empty function. However, this reference seems to have been removed in the later commit 10dcc58 and its version of libwabt.js. This function seems to have been empty even in older commits (such as commit 6aac429 and its version of libwabt.js, where the file had not been edited for four years prior). As such, it appears that simply deleting the module.resolveNames() call in demo.js seems to fix the error - though it should be double-checked that there are no side effects of this deletion.

This is my first attempted contribution to any major open source project, so please let me know if there are any additional guidelines I may have missed or if there is any other information I should provide. Thanks!

@sbc100

sbc100 commented Mar 23, 2026

Copy link
Copy Markdown
Member

@kevmoo WDYT?

@sbc100

sbc100 commented Mar 23, 2026

Copy link
Copy Markdown
Member

Seems reasonable but I think we should do a little more investigation as to what happened to this function. I'll see see what gemini comes up with as an explanation for why we can or cannot remove this.

@kevmoo

kevmoo commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

I'm embarrassed that it slipped through!

@zherczeg

Copy link
Copy Markdown
Collaborator

Btw what happened with the macos build? It seems waiting forever for all patches. It should not block this change.

@sbc100

sbc100 commented Mar 24, 2026

Copy link
Copy Markdown
Member

macos-14 was replaced with macos-latest.. I'll update the expectation list.

@sbc100

sbc100 commented Mar 24, 2026

Copy link
Copy Markdown
Member

fixed

@sbc100

sbc100 commented Mar 24, 2026

Copy link
Copy Markdown
Member

thanks @yuvraj-sahu, this change LGTM

@sbc100

sbc100 commented Mar 24, 2026

Copy link
Copy Markdown
Member

By the way I did a little digging and found that resovleNames was made into stub/no-op back in #1398. Seems reasonable that we have now just completely removed it.

@sbc100 sbc100 merged commit 5551e79 into WebAssembly:main Mar 24, 2026
17 checks passed
@yuvraj-sahu

Copy link
Copy Markdown
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants