hardyscc/aws-nestjs-starter

Serverless not finding modules running Nest.js

Joshua-Enrico opened this issue · 4 comments

Everything was fine until I started importing services from other modules, I'm looking for a reference to this error, the error occurs when you run it with lambda, but everything is fine with nest js
image

`service: sales-api-dev

plugins:

  • serverless-plugin-typescript
  • serverless-plugin-optimize
  • serverless-offline
  • serverless-stage-manager

provider:
name: aws
apiGateway:
restApiId: hiden
restApiRootResourceId: hiden
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:DescribeTable
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource: arn:aws:dynamodb:${self:provider.region}::

runtime: nodejs14.x
stage: ${opt:stage, 'dev'}
region: us-east-2

package:
exclude:
- .gitignore
- README.md
- serverless.yml
- nest-cli.json
- .prettierrc
excludeDevDependencies: true
individually: true

functions:
main:
handler: src/main.handler
events:
- http:
cors: true
path: '{proxy+}'
method: any

custom:
stages:
- dev
- test
- acc
- prod
serverless-offline:
useChildProcesses: true
`
Any help in this regard would be very helpful, I clarify that it only happens with serverless

@Joshua-Enrico can u try without serverless-plugin-optimize plugin

@hardyscc not working , ill by searching why .
At the moment I am working with nest js and later I upload the changes with serverless, as soon as I find a solution I pass it here, since from what I see the same thing happens with the base template that is being provided, for some reason it does not recognize the modules

@Joshua-Enrico FYI, I just tested this starter template without problem.

@hardyscc Good Info, I'll check my serverless version, thanks for your work mate