Skip to content

Stuck on Need a faster logging experience when using serverless-stack with serverless-esbuild #248

Open

Description

@keyvhinng

After running serverless deploy, the lambda is indeed deployed to LocalStack but the process is still running and stuck on:

Need a faster logging experience than CloudWatch? Try our Dev Mode in Console: run "serverless dev"

How to reproduce:

serverless.yml

service: serverless-localstack

frameworkVersion: "3"

provider:
  name: aws
  runtime: nodejs18.x

plugins:
  - serverless-esbuild
  - serverless-localstack

functions:
  hello:
    handler: handler.hello

handler.ts

export const hello = async (event) => {
  return {
    statusCode: 200,
    body: JSON.stringify({
      message: "Go Serverless",
      input: event,
    }),
  };
};

Activity

  1. cpcwood commented on Apr 29, 2024

    @cpcwood

    I did a bit of debugging on this and it seems like it might be related to this PR in esbuild.

    When serverless-localstack overwrites the esbuild hooks it removes the await this.disposeContexts(); call from the esbuild hook which seems to make esbuild hang.

  2. robertveloso commented on Jun 8, 2024

    @robertveloso

    I have a monorepo with a lot of packages, and just realize that the order matters here, putting esbuild after localstack fixes the issue.

    this works:
    plugins:

    • serverless-localstack
    • serverless-esbuild

    this get stuck:
    plugins:

    • serverless-esbuild
    • serverless-localstack
  3. brucekaufman commented on Jun 14, 2024

    @brucekaufman

    I have a monorepo with a lot of packages, and just realize that the order matters here, putting esbuild after localstack fixes the issue.

    this works: plugins:

    * serverless-localstack
    
    * serverless-esbuild
    

    this get stuck: plugins:

    * serverless-esbuild
    
    * serverless-localstack
    

    the problem is that this doesn't actually work. None of the lambdas deploy successfully in local stack when i do this even though the deployment completes. It looks like LS plugin has to run first in order to work, so this is not a viable workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions