question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Multiple Runtimes (Python/NodeJS) in same serverless.yml

See original GitHub issue

Currently esbuild wants to also compile my python code.

Steps to replicate

  typescript-lambda:
    handler: ./src/typescript/lambda.handler
  python:
    handler: ./src/python/lambda.handler
    runtime: python3.9

$ yarn sls package

Serverless: Compiling to node14 bundle with esbuild...
Cannot locate handler - ./src/python/lambda not found
 
 Error ---------------------------------------------------
 
  Error: Compilation failed. Please ensure you have an index file with ext .ts or .js, 
  or have a path listed as main key in package.json

Proposed Solution

  • Ignore any files that have entry points, where the runtime is not nodejs.xx.x; this will prevent esbuild attempt to compile them.
  • This ignore should include not adding node_modules to the zip file created for those

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
samchungycommented, Nov 9, 2021

Thanks guys, I’ll take a look some time in the next 24 hours.

1reaction
samchungycommented, Nov 10, 2021

No problemo, glad I could help. Hope you have a good day 🙂

@shichongrui if you have any other issues, feel free to open a new issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use multiple runtimes in a single serverless microservice
How to build an application using multiple runtimes to supported mixed-language development with the Serverless Framework.
Read more >
Support multiple runtimes? · Issue #80 · serverless ... - GitHub
I'm trying to use this plugin in a multiple runtime environment (python + node.js). Does serverless-python-requirements support multiple ...
Read more >
Serverless framework - Use multiple runtimes (TS / Python)
We would like to add one lambda, using python (because we want to embed the AWS CLI in this one, and I believe...
Read more >
Best practices for organizing larger serverless applications
For example, many web applications that are migrated to Lambda use web frameworks like Flask (for Python) or Express (for Node.js).
Read more >
AWS Lambda function with Serverless Framework - Medium
It manages your code as well as your infrastructure; It supports multiple languages (Node.js, Python, Java, and more).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found