Skip to content

Conversation

@gustavovalverde
Copy link

Problem

Console warning appears when using @serenity-kit/opaque: "using deprecated parameters for the initialization function; pass a single object instead"

Fixes #150

Root Cause

This was caused by two issues:

  1. Outdated wasm-bindgen version: Project was using 0.2.105, which had a bug where passing WASM data to init function incorrectly triggered deprecation warnings.

  2. Old initialization pattern: The template was using deprecated API call pattern init(wasmData()) instead of new object-based format.

Solution

Updated three files to resolve the issue:

  1. Cargo.toml: Upgraded wasm-bindgen from 0.2.105 to 0.2.106
  2. bin/templates/index.ts: Fixed initialization pattern from init(wasmData()) to init({module_or_path: wasmData()})
  3. bin/build.js: Fixed build script logic that tried to read package.json before it was created

Verification

  • Build completes without deprecation warnings
  • All 92 tests pass (46 ristretto + 46 p256 variants)
  • Example applications run without console warnings
  • No breaking changes to public API

@gustavovalverde gustavovalverde changed the title Fix wasm-bindgen deprecation warning (fixes #150) Fix wasm-bindgen deprecation warning Jan 12, 2026
- Update wasm-bindgen from 0.2.105 to 0.2.106
- Fix initialization pattern to use new API format
- Fix build script package.json creation order

Resolves console warning: 'using deprecated parameters for the initialization function; pass a single object instead'
@gustavovalverde gustavovalverde force-pushed the fix/wasm-bindgen-deprecation-warning branch from 6c5c58b to a0020eb Compare January 12, 2026 11:16
@gustavovalverde gustavovalverde changed the title Fix wasm-bindgen deprecation warning build: fix wasm-bindgen deprecation warning Jan 12, 2026
@gustavovalverde
Copy link
Author

cc: @nikgraf (sorry for the ping, but just for visibility) :)

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.

Console warning: "using deprecated parameters for the initialization function; pass a single object instead"

1 participant