Skip to content

Import __wbindgen_bigint_from_i64 with Non-JS-compatible Func Sigurature (i64 as parameter) #3095

@kylebarron

Description

@kylebarron

Describe the Bug

After upgrading from 0.2.82 to 0.2.83 I appear to have an issue using the generated code from webpack (with the bundler target of wasm-pack).

ERROR in ./node_modules/parquet-wasm/bundler/arrow2_bg.wasm
Import "__wbindgen_bigint_from_i64" from "./arrow2_bg.js" with Non-JS-compatible Func Sigurature (i64 as parameter) can only be used for direct wasm to wasm dependencies
 @ ./node_modules/parquet-wasm/bundler/arrow2.js
 @ ./async_testing.js
 @ ./bootstrap.js

It looks like there were some bigint-related changes between 0.2.82 and 0.2.83 of wasm-bindgen. I had been returning i64 from some functions without issue before bumping to 0.2.83 so I think it's a change in wasm-bindgen

Steps to Reproduce

git clone https://github.com/kylebarron/parquet-wasm
cd parquet-wasm
git checkout e610ef632cb10d4618971a1fa8dcdb2005e673cf

# paths I have to set on MacOS for one of the dependencies to build correctly for wasm32
export PATH="/usr/local/opt/llvm/bin/:$PATH"
export CC=/usr/local/opt/llvm/bin/clang
export AR=/usr/local/opt/llvm/bin/llvm-ar

# Calls a build script that builds several wasm-pack binaries
yarn build

# Start webpack test project (originally from the wasm-pack template)
cd www
yarn install
yarn start

Specifically, the wasm-pack flags provided to the bundle that fails to load is

wasm-pack build --release \
  --out-name arrow2 --target bundler --no-default-features \
  --features arrow2 --features reader --features writer \
  --features all_compressions --features async

Using the previous version of wasm-bindgen generated a _bg.js file where the only grep of bigint was:

export function __wbindgen_bigint_new(arg0, arg1) {

Now there's a new function that triggers this webpack error:

export function __wbindgen_bigint_from_i64(arg0) {

Expected Behavior

Able to run application through webpack

Additional Context

wasm-pack 0.10.3
rustc 1.63.0 (4b91a6ea7 2022-08-08)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions