serverless / serverless/examples

aws-node-typescript-nest Deploy Error

Open
#386 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
11.5k
Forks
4.4k
Avg merge
2h 55m
Merged PRs (30d)
3

Description

Hello, I am trying the example for aws-node-typescript-nest. If I clone it and run it locally or deploy it, it works nicely, however I am trying to add the Mongoose Module for Nest and connect to my Atlas DB Cluster. If I test locally, it works nicely again (meaning it fetches information from the Cloud DB for instance). However when I deploy to AWS it gets deployed with no errors but when I try hitting my API gateway endpoint I get an Internal Server Error.

If I check out the logs for the function all I can see is the following

*Syntax error in module '_optimize/serverless-nest-example-v2-dev-main/src/main': SyntaxError
async function
asyncIterator() {
^

SyntaxError: Unexpected token '*'
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:616:28)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)**

I honestly have no clue on how to proceed to solve this error. I have checked and my environment variable for connecting to the DB is properly set on my lambda, as well as the VPC configuration.

Any guidance or help is much appreciated...

Thanks

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the aws-node-typescript-nest example and its src/main entry point, then reproduce the deployment and inspect the AWS Lambda logs for the reported asyncIterator syntax error. Compare the local and deployed environments, including the Mongoose and Atlas DB setup; done means the API Gateway endpoint responds without the reported Internal Server Error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, typescript
Domain
api, backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.