I was able to resolve this error by changing the placement of the serverless-tscpaths plugin in serverless.yml file.
Now I am with another error as below.
{
"errorType": "TypeError",
"errorMessage": "module.require is not a function",
"stack": [
"TypeError: module.require is not a function",
" at Object.default_1 [as default] (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:59247:23)",
" at Object.generateSchemaHash (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:59389:31)",
" at ApolloServer.generateSchemaDerivedData (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:58226:41)",
" at new ApolloServerBase (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:58145:38)",
" at new ApolloServer (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:59709:9)",
" at GraphQLModule.registerExpress (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:26510:30)",
" at GraphQLModule.registerGqlServer (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:26495:18)",
" at GraphQLModule.<anonymous> (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:26485:18)",
" at Generator.next (<anonymous>)",
" at fulfilled (/var/task/_optimize/cosmos-graphql-qavj/src/lambda.js:827857:62)",
" at processTicksAndRejections (internal/process/task_queues.js:97:5)"
]
}
These are the list of plugins I am currently using
- serverless-plugin-typescript
- serverless-tscpaths
- serverless-plugin-optimize
- serverless-offline
- serverless-domain-manager
Am I missing the usage of serverless-webpack?