Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--stage Flag #1793

Open
dmartinezbello opened this issue May 31, 2024 · 3 comments
Open

--stage Flag #1793

dmartinezbello opened this issue May 31, 2024 · 3 comments

Comments

@dmartinezbello
Copy link

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
Copy link
Collaborator

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

@ktwbc
Copy link
Contributor

ktwbc commented Jul 8, 2024

does wrapping it in quotes with equals make a difference?

serverless offline start --stage="dev"

@ktwbc
Copy link
Contributor

ktwbc commented Jul 8, 2024

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants