Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverless not finding modules running Nest.js #1270

Closed
Joshua-Enrico opened this issue Apr 20, 2022 · 4 comments
Closed

Serverless not finding modules running Nest.js #1270

Joshua-Enrico opened this issue Apr 20, 2022 · 4 comments

Comments

@Joshua-Enrico
Copy link

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

@hardyscc
Copy link
Owner

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

@Joshua-Enrico
Copy link
Author

@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

@hardyscc
Copy link
Owner

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

@Joshua-Enrico
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants