dherault / dherault/serverless-offline
--stage Flag
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 811
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
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!

Contributor guide
Assessment
This issue has not been assessed yet.