Skip to content

Browser Support / Wasm Threading & Cross-Origin Isolation (COI) Failure #443

@iteyelmp

Description

@iteyelmp

Hello team,

We are using your NAPI-RS Wasm module and face two major blockers for browser SDK usage:

1. Wasm Threading Requires Unfeasible Server Configuration
The module's use of Wasm Threads/SharedArrayBuffer forces the browser to require Cross-Origin Isolation (COI).

Error: DataCloneError: SharedArrayBuffer transfer requires self.crossOriginIsolated.

Impact: This imposes a mandatory COOP/COEP HTTP header setup on all end-users, which is unacceptable for a public SDK.

2. Packaging/Loading Failure
Standard bundlers (Vite/Webpack) fail to reliably resolve and load the necessary Wasm binary and its Worker script in the browser environment.

Request for Seamless Browser Solution
We need an official strategy to eliminate these deployment blockers. Please provide guidance or a configuration change for NAPI-RS to support one of the following:

A. Max Compatibility Build (No COI Required):

Goal: A non-threaded Wasm build that uses traditional data transfer, allowing the module to work out-of-the-box in any browser environment (no COOP/COEP required).

B. Improved Threaded Distribution:

Goal: A packaging solution that makes the Wasm binary and Worker files seamlessly resolvable by common bundlers, even if COOP/COEP is still required.

Your help in making this module browser-friendly is appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions