Missing Argon2 module when deploying app to docker machine that uses Argon2

Wappler Version : v5.3.2
Operating System : macOS Monterey 12.6
Server Model: node js
Database Type: postgresql
Hosting Type: docker

Expected behavior

What do you think should happen?

When I deploy my application that uses Argon2 hashing to a docker-machine (using Wappler) I would expect it to work.

Actual behavior

It appears that as part of the building and deploying the docker container, Wappler is missing the package include for Argon2.

Here’s the error message I am given:

server-connect:app Executing action step passwordHash +1ms
server-connect:app options: { password: ‘{{$_POST.admin_password}}’, algo: ‘argon2id’ } +1ms
server-connect:server Got error? Error: Cannot find module ‘argon2’
server-connect:server Require stack:
server-connect:server - /opt/node_app/lib/modules/crypto.js
server-connect:server - /opt/node_app/lib/core/app.js
server-connect:server - /opt/node_app/lib/core/middleware.js
server-connect:server - /opt/node_app/lib/setup/routes.js
server-connect:server - /opt/node_app/lib/server.js
server-connect:server - /opt/node_app/index.js
server-connect:server at Function.Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
server-connect:server at Function.Module._load (node:internal/modules/cjs/loader:841:27)
server-connect:server at Module.require (node:internal/modules/cjs/loader:1067:19)
server-connect:server at require (node:internal/modules/cjs/helpers:103:18)
server-connect:server at App.exports.passwordHash (/opt/node_app/lib/modules/crypto.js:8:18)
server-connect:server at App._exec (/opt/node_app/lib/core/app.js:584:57)
server-connect:server at App._exec (/opt/node_app/lib/core/app.js:551:28)
server-connect:server at App.exec (/opt/node_app/lib/core/app.js:520:20)
server-connect:server at App.condition (/opt/node_app/lib/modules/core.js:109:28)
server-connect:server at App._exec (/opt/node_app/lib/core/app.js:584:57) {
server-connect:server code: ‘MODULE_NOT_FOUND’,
server-connect:server requireStack: [
server-connect:server ‘/opt/node_app/lib/modules/crypto.js’,
server-connect:server ‘/opt/node_app/lib/core/app.js’,
server-connect:server ‘/opt/node_app/lib/core/middleware.js’,
server-connect:server ‘/opt/node_app/lib/setup/routes.js’,
server-connect:server ‘/opt/node_app/lib/server.js’,
server-connect:server ‘/opt/node_app/index.js’
server-connect:server ]
server-connect:server } +0ms

How to reproduce

Build an application that uses Argon2. Deploy it to a docker machine using Wappler. Watch the missing module error when you try to log in with Argon2 hashing.

I respect there might be a manual way of fixing this (by updating package.json), however I’ve not been able to find an example of how to do this.

Could you in the wappler side menu click the file manager, then you should see a option to view files next to the search.

Inside the very first folder will be package.json open this and see if argon2 is mentioned under dependencies

It’s not in package.json.

Do I need to manually add it myself?

If so, would you be able to provide and example of the line I need to add? :slight_smile:

Under dependencies:

At the very bottom of the dependencies add first a comma to the last one you currently have listed so it looks like the lines above all ending in commas and then below add:

"argon2": "^0.28.3"

No need for a comma on this one as its the last dependency listed

Once added save the file and then at the very bottom of wappler near the terminal you want to ‘install node packages’

Awesome. That’s got it working. Thank you!!

Should this still be reported as a Wappler bug?

I’d assume it would add the dependency for you (like it does for other modules)?

Yeah I would keep this as a bug report for the team to investigate with it not getting added into the package.json automatically for you

Glad you got it working :partying_face:

1 Like