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.

Custom runtime not workig for deployment of single function

See original GitHub issue

This is a (Bug Report)

Description

For bug reports:

  • What went wrong? serverless deploy function -f functionName always triggers the “serverless-webpack” plugin even when the runtime is not “nodejs”.
  • What did you expect should have happened? serverless-webpack should not trigger on non nodejs runtimes (e.g. python)

The issue resides in within “lib/validate.js”. The pull request (https://github.com/serverless-heaven/serverless-webpack/pull/579/files) applied the custom runtime only for “serverless deploy” but not for “serverless deploy function -f”.

Similar or dependent issue(s):

Additional Data

  • Serverless-Webpack Version you’re using: 5.4.0
  • Webpack version you’re using: 4.46.0
  • Serverless Framework Version you’re using: 2.31.0
  • Operating System: Amazon Linux v2
  • Stack Trace (if available):

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chrisweidyacommented, Jun 14, 2021

I ran into this problem too in 5.5.1. Not sure if I missed any configs I could’ve set. I am trying to have one function run on go and the rest on nodejs.

serverless deploy runs fine as serverless-webpack will filter out non-node functions now and consolidate entries to only nodejs runtimes. But if the only function’s runtime is not nodejs or if you run serverless deploy function -f nonNodejsFunctionName, slsw.entries (which I am using in webpack config) will result in an empty object and this will cause webpack to error due to an empty entry field.

I modified the code a bit on my end and got it to work by checking for empty entries after the ‘validate’ stage and exiting the next stages early. However I think not having serverless-webpack run at all may be a better solution in these cases.

0reactions
j0k3rcommented, Jun 29, 2021

In fact, it might the fastest solution. I tried to hook into validate, compile & package but it adds a lot overhead.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot deployment issues in Lambda
Learn how to troubleshoot common deployment issues in Lambda. ... The handler is the method in your function's code that the runtime runs...
Read more >
Unable to deploy single lambda function for version 1.52.1
sls deploy -f "function_name" is not working throwing and exception. My serverless version is: Framework Core: 1.52.1. Plugin: 3.0.0
Read more >
.NET 6 Custom Runtime for AWS Lambda | no dogma blog
You can't yet run .NET 6 on AWS Lambda with the familiar managed runtime, but you can with a custom runtime. Here are...
Read more >
Deploy an Access application - Microsoft Support
What do you want to do? · Plan for deployment · Deploy an Access application · Understand and download the Access Runtime ·...
Read more >
About Custom runtimes - App Engine - Google Cloud
When you use a custom runtime, you must write your application code to handle certain flexible environment life-cycle and health checking requests. Start...
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