Closed ggmartins closed 4 years ago
To find the actual problem, I think you should post your full serverless.yml.
thanks, that's ok, I fixed this by generating a new configuration from template:
sls create --template aws-nodejs-typescript --path iotpro
For bug reports:
webpack throwing an error running
sls deploy
orsls offline
no errors
plugins:
...
{ "name": "iotpro", "version": "0.0.1", "description": "IoT Device Managing and Profiling", "main": "handler.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Guilherme Martins", "license": "ISC", "dependencies": { "axios": "^0.19.2", "http-aws-es": "^6.0.0", "jsonwebtoken": "^8.5.1", "middy": "^0.36.0", "source-map-support": "^0.5.19", "uuid": "^8.1.0" }, "devDependencies": { "@types/jest": "^26.0.0", "@types/node": "^14.0.13", "aws-sdk": "^2.696.0", "aws-xray-sdk": "^3.1.0", "bcryptjs": "^2.4.3", "elasticsearch": "^16.7.1", "serverless": "^1.72.0", "serverless-aws-documentation": "^1.1.0", "serverless-dynamodb-local": "^0.2.39", "serverless-iam-roles-per-function": "^2.0.2", "serverless-offline": "^6.4.0", "serverless-reqvalidator-plugin": "^1.0.3", "serverless-s3-local": "^0.6.2", "serverless-webpack": "^5.3.2", "ts-loader": "^7.0.5", "typescript": "^3.9.5", "webpack": "^4.43.0" } }
const path = require('path'); const slsw = require('serverless-webpack');
module.exports = { mode: slsw.lib.webpack.isLocal ? 'development' : 'production', entry: slsw.lib.entries, devtool: 'source-map', resolve: { extensions: ['.js', '.jsx', '.json', '.ts', '.tsx'], }, output: { libraryTarget: 'commonjs', path: path.join(__dirname, '.webpack'), filename: '[name].js', }, target: 'node', module: { rules: [ // all files with a
.ts
or.tsx
extension will be handled byts-loader
{ test: /.tsx?$/, loader: 'ts-loader' }, ], }, };sls deploy Serverless: Bundling with Webpack...
Webpack Options Validation Error -----------------------
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
For feature proposals:
Similar or dependent issue(s):
12345
Additional Data