serverless / serverless

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.
https://serverless.com
MIT License
46.39k stars 5.7k forks source link

Serverless command "offline" not found #12578

Open krisalay opened 3 months ago

krisalay commented 3 months ago

Issue description

I am getting the error: Environment: linux, node 20.14.0, framework 3.39.0 (local), plugin 7.2.3, SDK 4.5.1 Docs: docs.serverless.com Support: forum.serverless.com Bugs: github.com/serverless/serverless/issues

Error: Serverless command "offline" not found. Run "serverless help" for a list of all available commands.

Context

I am using

"serverless": "^3.39.0",
"serverless-dotenv-plugin": "^6.0.0",
"serverless-esbuild": "^1.52.1",
"serverless-offline": "^13.6.0",
fabianobonomini commented 3 months ago

same problem here. I upgraded to serveless v4. give it a try if you can

NicoHinderling commented 3 months ago

@austencollins would maintenance of https://github.com/dherault/serverless-offline ever be taken over or at least have direct support by the serverless company itself?

I've finally completed my experimental migration project (serverless3 -> 4 & npm -> pnpm) and the only two blocking things left are:

  1. local handlers not working for serverless4 (https://github.com/serverless/serverless/issues/12621) 🙏
  2. serverless-offline not working for serverless4 (https://github.com/dherault/serverless-offline/issues/1800)

Seems like they are looking for maintainers and I imagine that supporting offline functionality is pretty important for other developers too

edit: shoutouts to hero @DorianMazur

eahefnawy commented 3 months ago

@NicoHinderling Have you tried using the new serverless dev command for local development? If you did, I'm curious to know what serverless-offline solves that dev mode doesn't 🤔 (other than actually being offline with no internet connection)

NicoHinderling commented 3 months ago

@NicoHinderling Have you tried using the new serverless dev command for local development? If you did, I'm curious to know what serverless-offline solves that dev mode doesn't 🤔 (other than actually being offline with no internet connection)

I just tried it out and I agree that serverless dev does seem like it would speed up iterative development when using our "dev" stage, but:

  1. Right now I share our dev environment with several other engineers, so I don't want to use dev directly all the time. Being able to use it offline is really convenient for this.
  2. I actually dealt with an outage recently where I control + C'd mid deploy to our biggest service's dev environment and it totally broke our cloudformation :( I had to delete everything and re-create it from the ground up, so particularly for that service, I'd probably never use serverless dev altogether given:

    a. what serverless dev does under the hood b. how fragile that service apparently is

eahefnawy commented 3 months ago

@NicoHinderling Thanks for that feedback! That's really helpful.

You could also do sls dev --stage local or sls dev --stage nico, wouldn't that solve both issues?

NicoHinderling commented 3 months ago

@NicoHinderling Thanks for that feedback! That's really helpful.

You could also do sls dev --stage local or sls dev --stage nico, wouldn't that solve both issues?

these still involve deploying, which also increases our number of resources for that service. We've been hitting the limit recently, but I agree that could be a potential alternative for others

eahefnawy commented 3 months ago

Hmm yeah, that is a good point 🤔

DorianMazur commented 2 months ago

@krisalay Can you check with serverless-offline v14?