Skip to content

Conversation

@MarcusCaspeco
Copy link

@MarcusCaspeco MarcusCaspeco commented Nov 24, 2025

Description (required)

astro dev -- --mode dev does not work, astro dev --mode dev does work. Not sure if this was changed recently and docs weren't updated, but this had me stuck for a while.

Not sure about --devOutput but since it's documented as a CLI command to astro I assume that the double dashes should be removed for that as well.

Related issues & labels (optional)

  • Suggested label: Improve or update documentation

No need for first time contributor, I am @MarcusOtter on work account 🕵️

@netlify
Copy link

netlify bot commented Nov 24, 2025

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9c74e62
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/69243c15ffba1a0008fac1dd
😎 Deploy Preview https://deploy-preview-12781--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/environment-variables.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@astrobot-houston
Copy link
Contributor

Hello! Thank you for opening your first PR to Astro’s Docs! 🎉

Here’s what will happen next:

  1. Our GitHub bots will run to check your changes.
    If they spot any broken links you will see some error messages on this PR.
    Don’t hesitate to ask any questions if you’re not sure what these mean!

  2. In a few minutes, you’ll be able to see a preview of your changes on Netlify 🥳.

  3. One or more of our maintainers will take a look and may ask you to make changes.
    We try to be responsive, but don’t worry if this takes a few days.

@MarcusCaspeco MarcusCaspeco marked this pull request as ready for review November 24, 2025 11:07
@ArmandPhilippot
Copy link
Member

Hi Marcus, I checked using the minimal template on Linux and this seems to work for me:

❭ npm run astro dev -- --mode dev

> astro-escape-cli@0.0.1 astro
> astro dev --mode dev

15:56:36 [types] Generated 0ms
15:56:36 [content] Syncing content
15:56:36 [content] Synced content

 astro  v5.16.0 ready in 51 ms

┃ Local    http://localhost:4321/
┃ Network  use --host to expose

15:56:36 watching for file changes...

The escape characters before the options (e.g. --) was a requirement for PowerShell + npm users. But, IIRC, there have indeed been recent changes on PowerShell side... I think it was to make the escape characters unnecessary, not to make the command invalid when using them? 😅

Since I don't have PowerShell, can you confirm the environment used for your test? I think on Linux/Mac the escapement was never a requirement (but it was working). So, now, if it fails with PowerShell, maybe we should apply your changes here (and probably on other pages?). Otherwise, I wonder why it's not working for you...

@delucis
Copy link
Member

delucis commented Nov 24, 2025

IIRC it’s not only PowerShell in this case. PowerShell needed double double dashes (i.e. npm run astro dev -- -- --mode dev), but I believe -- at least always used to be required with npm on all platforms to indicate that the options are to be passed to the command being run and not directly to npm itself.

@ArmandPhilippot
Copy link
Member

Oh you're right, I mixed up things! I read that as if it were a double --. 🤦🏽 If I try without --, I get:

npm warn "dev" is being parsed as a normal command line argument.
npm warn Unknown cli config "--mode". This will stop working in the next major version of npm.

So, -- seems to be required for npm...

@MarcusCaspeco
Copy link
Author

MarcusCaspeco commented Nov 24, 2025

Ahh, right, this is my bad, I forgot this documentation is in the context of npm run! (as you can see in my PR description 😅)

I was adding it in my package.json like this, providing the arguments directly to the Astro CLI:

{
    "scripts": {
        "dev": "astro dev --mode dev"
    }
}

(and then just npm run dev)

In which case astro dev -- --mode dev would not work, since I'm passing it to the CLI directly, not through npm.

I know you usually have to -- -- when using npm run ..., like you mentioned Chris, I think I just forgot to read what these docs were telling me🤦

Sorry! I'll blame monday morning brain

@MarcusCaspeco MarcusCaspeco deleted the patch-1 branch November 24, 2025 16:33
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

Successfully merging this pull request may close these issues.

4 participants