I have the following code, which uses the argon2-browser
package to hash the user's password in a server function:
export const authSignup = server$(async function (
firstName: string,
lastName: string,
email: string,
password: string,
passwordConf: string,
username: string,
) {
...
const name = firstName.trim() + ' ' + lastName.trim()
const hash = await argon2.hash({ pass: password, salt: 'somesalt' })
...
})
When deploying to Vercel using the Vercel-Edge
adapter (using npm run deploy
), I get the following error message:
RollupError: Cannot bundle Node.js built-in "path" imported from "node_modules/argon2-browser/dist/argon2.js". Consider disabling ssr.noExternal or remove the built-in dependency.
Does anyone know how to get around this, or if there is another package that lets you hash passwords without this issue? Ideally this would not require moving off of Vercel. TYA!
Have you tried setting path to external?