I'm getting 502 responses when trying to simply add const solc = require('solc') to a deployed AWS lambda function. I've successfully used used a variety of different node packages in this lambda function with no problems. Also, I've used the solc module locally and in other contexts with no problems. What can I do to get to successfully require the solc module?
Lambda function:
const solc = require('solc')
module.exports = {
constructContractTx: async(event, web3) => {
// compileContract(event)
return {
body: 'testing',
status: 200
}
}
}
package.json:
{
"name": "...",
"version": "1.0.0",
"description": "...",
"main": "app.js",
"repository": "...",
"author": "Chris Dougherty",
"license": "MIT",
"dependencies": {
"@alch/alchemy-web3": "^1.1.9",
"@ethereumjs/common": "^2.6.2",
"@ethereumjs/tx": "^3.5.0",
"axios": "0.21.1",
"dotenv": "^15.0.0",
"faunadb": "^4.4.1",
"fs": "^0.0.1-security",
"path": "^0.12.7",
"solc": "0.8.10",
"web3": "1.5.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
}
}