Skip to content

Timeouts for async components are not cleared, blocking node on ssr #9648

Closed
@ahus1

Description

@ahus1

Version

2.6.9

Reproduction link

Vue:

Nuxt:

Steps to reproduce

Vue:

  • Add an async component with a delay/timeout
  • When the real component is rendered and the loading and error components never showed, the timeouts are not cleared, but will be triggered.

Nuxt:

What is expected?

Vue:

  • When component is rendered, the timeout and delay timeouts should be cleared if the haven't fired yet.

Nuxt:

  • generation should complete without an error

What is actually happening?

Vue:

  • Timeouts for delay and timeout fire after the component has been rendered.

Nuxt:

  • node blocks after rendering. Nuxt presents and error message:

The command 'nuxt generate' finished but did not exit after 5s
This is most likely not caused by a bug in Nuxt.js
Make sure to cleanup all timers and listeners you or your plugins/modules start.
Nuxt.js will now force exit 

DeprecationWarning: Starting with Nuxt version 3 this will be a fatal error

This happens both for timeout and loading elements. I'm about to submit a PR submitted as #9649.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions