"bcrypt" module in Actions throwing errors

Problem Statement

We are trying to use bcrypt in action and found that only bcryptjs works in Action.

If adding “bcrypt” as a dependency in Action like

const bcrypt = require('bcrypt')

when logging into the app, we received the below error.

{

"code": 400,

"details": "",

"error": "Cannot find module '/data/layers/layers-r__3/r__3yt2v38jTgsgrgAlnL68Iq7nlbfMrB5za8DVerkU/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node'

Require stack:

- /data/layers/layers-r__3/r__3yt2v38jTgsgrgAlnL68Iq7nlbfMrB5za8DVerkU/node_modules/bcrypt/bcrypt.js

- /data/io/node16/7d7e04be-0d5d-4014-afa1-e0b784dc63f1/webtask.js",

"message": "Compilation failed: Cannot find module '/data/layers/layers-r__3/r__3yt2v38jTgsgrgAlnL68Iq7nlbfMrB5za8DVerkU/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node'

Require stack:

- /data/layers/layers-r__3/r__3yt2v38jTgsgrgAlnL68Iq7nlbfMrB5za8DVerkU/node_modules/bcrypt/bcrypt.js

- /data/io/node16/7d7e04be-0d5d-4014-afa1-e0b784dc63f1/webtask.js",

"name": ""

}

The log has the below error:

Compilation failed: Cannot find module '/data/layers/layers-GYPQ/GYPQKPCSAzCm8d8BWI9e8OIeeMSFAb7wXVUmBNLY7Aw/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' Require stack: - /data/layers/layers-GYPQ/GYPQKPCSAzCm8d8BWI9e8OIeeMSFAb7wXVUmBNLY7Aw/node_modules/bcrypt/bcrypt.js - /data/io/node16/755b264c-32d4-4ead-a150-10bef65660bc/webtask.js [error code: access_denied]

Solution

In this doc, it says that bcrypt is not supported currently. Please communicate your use case with our Product team via the feedback page.