Getting this error from serverless-webpack:
ERROR in ../db/actions/index.js
Module not found: Error: Can't resolve 'amazon-dax-client' in '/var/task/db/actions'
@ ../db/actions/index.js 2:24-52
@ ../db/db.js
@ ./crop.js
My webpack.config.js file contains:
const slsw = require('serverless-webpack')
module.exports = {
entry: slsw.lib.entries,
target: 'node',
externals: {
sharp: 'commonjs sharp',
},
// Run babel on all .js files and skip those in node_modules
module: {
rules: [{
test: /\.js$/,
loader: 'babel-loader',
include: __dirname,
exclude: /node_modules/,
}]
}
}
The amazon-dax-client
module is present in node_modules.
I've rolled back to the last versions of webpack and serverless-webpack that worked for me:
"serverless-webpack": "4.3.0",
"webpack": "3.11.0"
Any ideas on how to resolve or to get additional logging output to track down the issue?
Can you try removing the /node_modules/ exclusion? If that's removed, I'd imagine it'd be able to get into that folder and do what you need. Since amazon-dax-client is in that folder, and you're telling webpack to ignore the node_modules folder, it won't be able to reach it. Let me know if that helps.