dherault / serverless-offline

Emulate AWS λ and API Gateway locally when developing your Serverless project
MIT License
5.16k stars 794 forks source link

--stage Flag #1793

Open dmartinezbello opened 1 month ago

dmartinezbello commented 1 month ago

Hi,

I am experiencing an issue with the --stage flag. When I run my command with --stage, it does not work as expected. However, if I run the same command without --stage, everything works correctly.

Environment Details: Operating System: Windows Tool Version: 13.0.6 Node.js Version: 20.x Commands Executed: Command with --stage that fails:

serverless offline --stage dev Expected Result: The server should run locally with Serverless Offline.

Actual Result: ✖ Option "stage" is of type "undefined" but expected type "string". ServerlessError3: Option "stage" is of type "undefined" but expected type "string". at ensure_supported_command_default (file:///C:/Users/crist/.serverless/releases/4.0.33/package/dist/sf-core.js:1033:3087) at runFramework (file:///C:/Users/crist/.serverless/releases/4.0.33/package/dist/sf-core.js:1052:2858) at async route (file:///C:/Users/crist/.serverless/releases/4.0.33/package/dist/sf-core.js:1055:3074) at async Object.run2 [as run] (file:///C:/Users/crist/.serverless/releases/4.0.33/package/dist/sf-core.js:1055:4620) at async Object.handler (file:///C:/Users/crist/.serverless/releases/4.0.33/package/dist/sf-core.js:1055:9181) Command without --stage that works:

Steps to Reproduce: Install Serverless on Windows. Set up a Serverless project with serverless.yml. Run the command serverless offline --stage dev. Additional Information: The serverless.yml configuration includes the definition for the dev stage. This issue only occurs when the --stage flag is added. I would greatly appreciate any help or suggestions on how to resolve this issue. Thank you in advance!

Captura de pantalla 2024-05-31 a la(s) 1 08 28 p  m

DorianMazur commented 1 month ago

@dmartinezbello I don't see --stage in Readme, where did you find this?

ktwbc commented 12 hours ago

does wrapping it in quotes with equals make a difference?

serverless offline start --stage="dev"

ktwbc commented 12 hours ago

@dmartinezbello I don't see --stage in Readme, where did you find this?

it's part of base serverless, not offline specifically. I use it all the time so it def should work.