Skip to content

Application show starting screen after some inactivity time #1028

Closed

Description

@jeydi243

Environment

Reproduction

The error can be reproduced with this repo: https://github.com/jeydi243/sanua

Describe the bug

Hi ! When i run the application the first time it launch correctly but if i just let it for a moment and try to just reload the page it keep showing the loanding page:

Image

javascript console show: 503 (Service Unavailable)

Additional context

No response

Logs

85460161-60f5-45ee-a3fb-d3396c3fb5bd:1  GET http://localhost:3000/clients/85460161-60f5-45ee-a3fb-d3396c3fb5bd 503 (Service Unavailable)

Activity

  1. added theissue type on Aug 2, 2025
  2. github-actions commented on Aug 2, 2025

    @github-actions
    Contributor

    Would you be able to provide a reproduction? 🙏

    More info

    Why do I need to provide a reproduction?

    Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

    What will happen?

    If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

    If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

    How can I create a reproduction?

    Please use a template below to create a minimal reproduction

    Open v4 in Stackblitz Open v3 in Stackblitz

    Open v4 in CodeSandbox Open v3 in CodeSandbox

    A public GitHub repository is also perfect. 👌

    Please ensure that the reproduction is as minimal as possible. See more details in our guide.

    You might also find these other articles interesting and/or helpful:

  3. cernymatej commented on Aug 2, 2025

    @cernymatej
    Member

    Hi there
    The reproduction repository is probably private since I'm getting a 404. Also, was there anything else in the console other than the 503 log? How long was the app idle?

  4. jeydi243 commented on Aug 2, 2025

    @jeydi243
    Author

    Hi @cernymatej , it’s now public. In console the same message of 503. 10 to 15 minutes idle

  5. josuelrocha commented on Aug 3, 2025

    @josuelrocha

    This is happening to me too. It happens to me when the dev server is inactive for a while, but it also happens "randomly" while I'm actively developing the project. Another thing I noticed is that HMR also doesn't seem to work correctly with certain changes (e.g., one component updates, while another doesn't update). It used to work perfectly.

    Here are 2 console outputs from my dev server:

    .nuxt/dist directory has been removed. Restarting Nuxt...
    ℹ .nuxt/dist directory has been removed. Restarting Nuxt...
    
    ✔ Vite client built in 99ms                                                                                                                                     12:23:25 PM
    ✔ Vite server built in 95ms                                                                                                                                     12:23:25 PM
    ✔ Nuxt Nitro server built in 937ms                                                                                                                        nitro 12:23:26 PM
    ℹ Vite client warmed up in 2ms                                                                                                                                  12:23:26 PM
    ℹ nuxt.config.ts updated. Restarting Nuxt...                                                                                                                    12:23:26 PM   
    ℹ Vite server warmed up in 10ms                                                                                                                                 12:23:26 PM   
    ✔ Vite client built in 52ms                                                                                                                                     12:23:27 PM
    ✔ Vite server built in 53ms                                                                                                                                     12:23:27 PM
    ✔ Nuxt Nitro server built in 784ms                                                                                                                        nitro 12:23:29 PM
    ℹ Vite client warmed up in 1ms                                                                                                                                  12:23:29 PM
    ℹ Vite server warmed up in 8ms                                                                                                                                  12:23:29 PM
    

    Whenever I see .nuxt/dist directory has been removed. Restarting Nuxt... or nuxt.config.ts updated. Restarting Nuxt... in the console, I know this problem has occurred and I need to restart the dev server to get it working again.

    Note: These messages appear in the console even if these files or folders haven't been touched or changed.

    I'm on Windows 11 with Nuxt 4, everything updated to the latest version.
    Node v22.15.0

  6. dan-hale commented on Aug 3, 2025

    @dan-hale

    @josuelrocha HMR on pages is broken for me, but works fine on components.

    Also seeing the crashes after 10-15 minuets.

    Possibly a duplicate of nuxt/nuxt#32564?

  7. josuelrocha commented on Aug 4, 2025

    @josuelrocha

    @dan-hale about HMR, it may be related

  8. josuelrocha commented on Sep 3, 2025

    @josuelrocha

    Can anyone confirm if this crashing issue is only happening to all Windows users? Because in Nuxt v4.1, in all my projects, my dev server keeps crashing and I have to manually restart it from time to time.

  9. added theissue type on Sep 4, 2025
  10. transferred this issue fromnuxt/nuxton Sep 4, 2025
  11. aroneous commented on Sep 6, 2025

    @aroneous
    Contributor

    Note that in #1030 , I identified the cause of this as #913, and found that rolling back @nuxt/cli to 3.25.1 resolved the issue for me.

  12. kiansa commented on Sep 11, 2025

    @kiansa

    Please fix this issue it's very annoying.
    I've tried rolling back @nuxt/cli to 3.25.1 but the issue is still there.

    - Operating System: `Windows_NT`
    - Node Version:     `v22.18.0`
    - Nuxt Version:     `4.1.1`
    - CLI Version:      `3.28.0`
    - Nitro Version:    `2.12.4`
    - Package Manager:  `[email protected]`
    - Builder:          `-`
    - User Config:      `runtimeConfig`, `modules`, `devtools`, `supabase`, `css`, `routeRules`, `compatibilityDate`
    - Runtime Modules:  `@nuxt/[email protected]`, `@vueuse/[email protected]`, `@nuxtjs/[email protected]`, `[email protected]`
    - Build Modules:    `-`
    
    

    [vite] server connection lost. Polling for restart...

  13. josuelrocha commented on Sep 17, 2025

    @josuelrocha

    @danielroe could you please give this some urgent attention? developing on Windows with Nuxt has been a bit troublesome due to the crashes.

  14. dan-hale commented on Sep 17, 2025

    @dan-hale

    @josuelrocha This issue has been fixed for me after updating Nuxt CLI to 3.28.0 Perhaps you have outdated dependencies cached?

  15. aroneous commented on Sep 17, 2025

    @aroneous
    Contributor

    @dan-hale - your prior comment mentioned an issue with HMR, which doesn't sound relevant to the problem I encountered. Maybe there was a separate issue?

  16. dan-hale commented on Sep 17, 2025

    @dan-hale

    @aroneous I also experienced this bug. Both were fixed for me at the same time when updating nuxt and the cli on my project.

  17. aroneous commented on Sep 17, 2025

    @aroneous
    Contributor

    @dan-hale - I'm still seeing the issue on 3.28.0

  18. josuelrocha commented on Sep 18, 2025

    @josuelrocha

    @josuelrocha This issue has been fixed for me after updating Nuxt CLI to 3.28.0 Perhaps you have outdated dependencies cached?

    I have all packages updated to the latest version and Node.js 24. The problem persists.

    --

    The problem with this "fake change" is that Windows enables updating the file's "Last Access" metadata by default, while macOS disables it. Therefore, when simply opening or reading the file without modifying it, Node.js's "fs.watch" detects it as a modified file, but in reality, only the "Last Access" metadata was modified. This is causing the crash and the dev server to restart. I decided to disable the "Last accessed" update in Windows itself, since I really don't need this information at all (even because in macOS this is disabled by default), and also because it is a not so concise feature, since in Windows this information is updated with a 1 hour delay, which is why it gives the impression that the crashes occur during some period of inactivity.

    So, for those who want to get rid of this problem and fix it, do the following: open the terminal in administrator mode, and first check the current value of the "Last Access" feature:

    fsutil behavior query disablelastaccess
    

    Its value is probably:

    DisableLastAccess = 2  (System Managed, Last Access Time Updates ENABLED)
    

    (Check this only for the reason if you want to revert to the old value)

    So now disable it by setting the value to 1:

    fsutil behavior set disablelastaccess 1
    

    Check the current value now:

    fsutil behavior query disablelastaccess
    

    and the output will be:

    DisableLastAccess = 1  (User Managed, Last Access Time Updates DISABLED)
    

    That's it. No more crashes and fake changes in Nuxt on Windows.

  19. aroneous commented on Sep 18, 2025

    @aroneous
    Contributor

    The Windows-specific code in libuv that drives fs.watch registers for changes on access time to drive a change event. The documentation for fs.watch and fs.watchFile are a bit vague on the matter, but at least for watchFile it indicates:

    To be notified when the file was modified, not just accessed, it is necessary to compare curr.mtimeMs and prev.mtimeMs.

    The code in @nuxt/cli that listens for changes does not check mtime before acting on the change event. I think that type of check needs to be added, or to move back to chokidar which appears to have handled this sort of concern in the prior implementation (at least based on empirical evidence).

    The decision to emit change events on file access seems like an odd one on the part of libuv, and does not appear to be consistent across platforms, but that is the reality on Windows, so I think @nuxt/cli has to deal with it.

  20. danielroe commented on Sep 18, 2025

    @danielroe
    Member

    thank you for that context @aroneous 🙏

    let's aim to handle that within nuxt/cli ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions