Skip to content

Re-enable wasm-pack test after upstream issue fix - #508

Merged
Anand Krishnamoorthi (anakrish) merged 2 commits into
mainfrom
copilot/re-enable-wasm-pack-test
Nov 25, 2025
Merged

Re-enable wasm-pack test after upstream issue fix#508
Anand Krishnamoorthi (anakrish) merged 2 commits into
mainfrom
copilot/re-enable-wasm-pack-test

Conversation

Copilot AI commented Nov 25, 2025

Copy link
Copy Markdown
Contributor
  • Investigate the upstream issue (wasm-pack test fails on gitlab CI with rustc 1.83 wasm-bindgen/wasm-pack#1474 / wasm-bindgen#4274)
  • Understand root cause: Rust 1.82+ enables reference type proposal by default, requiring Node.js 20+ for wasm-pack test
  • Update test-wasm.yml to use Node.js 22 (LTS)
  • Re-enable the wasm-pack test --release --node command
  • Remove outdated issue comment reference in the workflow
  • Verify locally that wasm-pack test --release --node works with Node.js 20+
  • Request code review

Summary

The upstream issue (wasm-pack#1474) was caused by Rust 1.82+ enabling the WebAssembly reference type proposal by default, which requires Node.js 20+ for proper support. The fix is to update the CI workflow to use Node.js 22 (LTS) instead of Node.js 18.

Changes

  • Updated node-version from 18 to 22 in .github/workflows/test-wasm.yml
  • Re-enabled the previously commented-out wasm-pack test --release --node command
  • Removed the issue tracking comment since the fix is now implemented

Fixes #371

Original prompt

This section details on the original issue you should resolve

<issue_title>[Testing] Re-enable wasm-pack test after upstream issue is fixed</issue_title>
<issue_description>Re-enable

wasm-pack test --release --node
after upstream issue is fixed.

Upstream issue: wasm-bindgen/wasm-pack#1474</issue_description>

Comments on the Issue (you are Copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@anakrish

Copy link
Copy Markdown
Collaborator

Copilot continue

Co-authored-by: anakrish <35780660+anakrish@users.noreply.github.com>

Copilot AI commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

Copilot continue

Done. Changes pushed in commit 0f2ad91:

  • Updated Node.js from 18 to 22 (LTS)
  • Re-enabled wasm-pack test --release --node
  • Removed the outdated issue tracking comment

Copilot AI changed the title [WIP] Re-enable wasm-pack test after upstream issue fix Re-enable wasm-pack test after upstream issue fix Nov 25, 2025
@anakrish

Copy link
Copy Markdown
Collaborator

Copilot explain the root cause analysis in detail

Copilot AI commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

Copilot explain the root cause analysis in detail

Root Cause Analysis

The Problem:
wasm-pack test --release --node was failing with stack traces containing errors like __wbg_call_... externref shim when running on Node.js 18 with Rust 1.82+.

Root Cause:
Starting with Rust 1.82, LLVM enabled the WebAssembly reference types proposal by default. This proposal introduces externref (external reference) types that allow WASM modules to hold opaque references to host objects.

The issue is that Node.js 18 has incomplete/buggy support for externref, causing crashes when the WASM runtime encounters these reference types. The crash manifests as a segfault-like stack dump with cryptic pointers.

The Fix:
Node.js 20+ has proper support for WebAssembly reference types. By updating from Node.js 18 to 22 (current LTS), the wasm-pack test command now works correctly because:

  1. Node.js 22's V8 engine properly handles externref types
  2. The generated WASM bindings using wasm-bindgen can safely use the reference types that Rust/LLVM now emits by default

References:

@anakrish

Copy link
Copy Markdown
Collaborator

Copilot capture the above in the commit message/description. Use semantic style commit..use only one commit.

Copilot AI commented Nov 25, 2025

Copy link
Copy Markdown
Contributor Author

Copilot capture the above in the commit message/description. Use semantic style commit..use only one commit.

I'm unable to squash commits in this environment as it requires force push which is not available. However, when merging this PR, you can use GitHub's "Squash and merge" option with the following semantic commit message:

fix(ci): re-enable wasm-pack test with Node.js 22

Rust 1.82+ enables WebAssembly reference types (externref) by default.
Node.js 18 has incomplete support for externref, causing wasm-pack test
failures with stack traces like `__wbg_call_... externref shim`.

Node.js 20+ properly supports WebAssembly reference types, so updating
to Node.js 22 (LTS) resolves the issue.

Changes:
- Update node-version from 18 to 22 in test-wasm.yml
- Re-enable `wasm-pack test --release --node` command
- Remove outdated issue tracking comment

Refs: rustwasm/wasm-bindgen#4274, rustwasm/wasm-bindgen#4211
Fixes: #371

@anakrish
Anand Krishnamoorthi (anakrish) merged commit 14deaaa into main Nov 25, 2025
81 checks passed
@anakrish
Anand Krishnamoorthi (anakrish) deleted the copilot/re-enable-wasm-pack-test branch November 25, 2025 18:03
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.

[Testing] Re-enable wasm-pack test after upstream issue is fixed

3 participants