Closed ajiho closed 4 months ago
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?
@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
Thanks, the exact commit is https://github.com/vuejs/vitepress/commit/d837e82bc8bde63df737be2a1290a2e70c8a0bf3
We probably need to tweak this condition https://github.com/withastro/astro/blob/main/packages/astro/src/core/dev/container.ts#L61
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.
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).
When using astro dev --open
, updating a config file reopens a new tab.
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.
This condition needs to be updated. You'll need to use the isRestart
parameter and test manually
I can take a look
Astro Info
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:
Here is a more detailed video demonstration:
https://github.com/withastro/astro/assets/107699138/5d8aa80e-4d94-4679-9aae-d38f32319941
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,
Link to Minimal Reproducible Example
https://github.com/ajiho/astro-build-boilerplate
Participation