Skip to content

Dependency resolution error thrown when using @node-rs/argon2 with remote functions in dev #14519

@claytercek

Description

@claytercek

Describe the bug

When importing @node-rs/argon2 in a remote function and running the project with vite dev, a dependency resolution error is thrown by Vite, and the build fails. The error does not occur during build.

This error also does not occur when importing @node-rs/argon2 in a page load() function, only in remote functions.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-argon2-remote

the index page demonstrates the behavior with remote functions, and the /loader page demonstrates the behavior when calling the same function in a page load() fn.

Logs

7:45:25 AM [vite] (client) error while updating dependencies:
Error: Error during dependency optimization:

✘ [ERROR] Could not resolve "@node-rs/argon2-wasm32-wasi"

    node_modules/@node-rs/argon2/browser.js:1:14:
      1 │ export * from '@node-rs/argon2-wasm32-wasi'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  You can mark the path "@node-rs/argon2-wasm32-wasi" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.


    at failureErrorWithLog (/[project-path]/node_modules/esbuild/lib/main.js:1467:15)
    at /[project-path]/node_modules/esbuild/lib/main.js:926:25
    at /[project-path]/node_modules/esbuild/lib/main.js:1345:9
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

System Info

System:
    OS: macOS 26.0
    CPU: (12) arm64 Apple M4 Pro
    Memory: 708.56 MB / 24.00 GB
    Shell: 4.0.2 - /opt/homebrew/bin/fish
  Binaries:
    Node: 22.18.0 - ~/.local/share/mise/installs/node/22.18.0/bin/node
    npm: 10.9.3 - ~/.local/share/mise/installs/node/22.18.0/bin/npm
  Browsers:
    Chrome: 140.0.7339.133
    Safari: 26.0
  npmPackages:
    @sveltejs/adapter-auto: ^6.0.0 => 6.1.0 
    @sveltejs/kit: ^2.22.0 => 2.43.2 
    @sveltejs/vite-plugin-svelte: ^6.0.0 => 6.2.0 
    svelte: ^5.25.0 => 5.39.4 
    vite: ^7.0.4 => 7.1.7

Severity

annoyance

Additional Information

This is the same log message as #13061, but it only occurs during dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions