-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Bug
Copy link
Description
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.7Severity
annoyance
Additional Information
This is the same log message as #13061, but it only occurs during dev.
symsmith and Jerboas86
Metadata
Metadata
Assignees
Labels
No labels