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

If the -- open flag is used, any modifications to the packagist.json file will reopen the browser at this time #11374

Closed
1 task
ajiho opened this issue Jun 29, 2024 · 7 comments · Fixed by #11456
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: dev Related to `astro dev` CLI command (scope) good first issue Good for newcomers. If you need additional guidance, feel free to post in #dev on Discord help wanted Please help with this issue!

Comments

@ajiho
Copy link

ajiho commented Jun 29, 2024

Astro Info

unnecessary

If this issue only occurs in one browser, which browser is a problem?

chrome

Describe the Bug

If the -- open flag is used in the development script, every time the package.json file browser is modified, it will open a new tab
script:

"dev": "astro --config src/config/astro.config.mjs dev --open",

Here is a more detailed video demonstration:

kk.2024-06-29.23-12-22.mp4

Warehouse for reproducing examples:
https://github.com/ajiho/astro-build-boilerplate

What's the expected result?

The correct behavior should be to modify package.json, which should not have any response,I don't know if it's an issue with Astro or Vite regarding the occurrence of this behavior,If there are no issues with both, please tell me what to do? I have ensured that my vscdoe editor does not have any extensions that may affect it,
image

Link to Minimal Reproducible Example

https://github.com/ajiho/astro-build-boilerplate

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jun 29, 2024
@florian-lefebvre
Copy link
Member

I think that's because we do a full restart of the vite dev server each time a config file changes, so we tell vite to open a browser tab each time. @bluwy what do you think we should do?

@ajiho
Copy link
Author

ajiho commented Jul 8, 2024

@florian-lefebvre I have also provided feedback on this issue in vitepress based on vite, and they also have this issue, but they have already resolved it,issues/4001 I think you can refer to how it was resolved

@florian-lefebvre
Copy link
Member

Thanks, the exact commit is vuejs/vitepress@d837e82

@florian-lefebvre
Copy link
Member

@ajiho
Copy link
Author

ajiho commented Jul 11, 2024

Sorry, I can't be of much help. I just want to humbly ask the Astro team if this issue is difficult to handle? I'm just troubled by opening a new tab every time I modify packagejson.

@florian-lefebvre florian-lefebvre added help wanted Please help with this issue! - P3: minor bug An edge case that only affects very specific usage (priority) feat: dev Related to `astro dev` CLI command (scope) good first issue Good for newcomers. If you need additional guidance, feel free to post in #dev on Discord and removed needs triage Issue needs to be triaged labels Jul 11, 2024
@florian-lefebvre
Copy link
Member

florian-lefebvre commented Jul 11, 2024

Good first issue!

This is an opportunity for astro users to learn about how astro works by fixing a small but real bug. You can expect to get help setting up the dev environment, and understanding the project structure in #contribute channel of our discord server (https://astro.build/chat).

What's the bug?

When using astro dev --open, updating a config file reopens a new tab.

What's going wrong here?

When a config file changes, a full restart happens and the Vite dev server is recreated. That means a new tab will reopen each time.

Where do I start looking?

This condition needs to be updated. You'll need to use the isRestart parameter and test manually

@RickyC0626
Copy link
Contributor

I can take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: dev Related to `astro dev` CLI command (scope) good first issue Good for newcomers. If you need additional guidance, feel free to post in #dev on Discord help wanted Please help with this issue!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants