You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Press the "Click me" button to trigger dynamic component loading.
Turn on the internet connection.
Hello,
In my Vue app, I need to implement retry functionality for my dynamic components in case the client has internet connection problems and the component doesn't load the first time. According to the documentation, Vue provides an onError callback for defineAsyncComponent where I can call the retry function and reload the component from the server.
When I disable the internet connection and trigger component loading, it fails into the onError callback as expected. But when I enable my internet connection and call retry, the component still fails into onError and doesn't reload as expected.
defineAsyncComponent call onError callback if it cant load component. defineAsyncComponent reload component properly if retry function called and there is no any connecton problems
What is actually happening?
defineAsyncComponent didnt reload component properly if retry function called and there is no any connecton problems
When the browser fetches a file, it caches the response regardless of whether it succeeds or fails. Therefore, each time you call retry (recalling the loader), it won’t initiate a new network request. Instead, it will immediately return the cached response. If the initial fetch fails, it will continue to return the failed response.
Vue version
3.4.31
Link to minimal reproduction
https://github.com/adnovikov/defineAsyncComponent-issue/blob/main/src/App.vue#L21
Steps to reproduce
Hello,
In my Vue app, I need to implement retry functionality for my dynamic components in case the client has internet connection problems and the component doesn't load the first time. According to the documentation, Vue provides an
onError
callback fordefineAsyncComponent
where I can call theretry
function and reload the component from the server.When I disable the internet connection and trigger component loading, it fails into the
onError
callback as expected. But when I enable my internet connection and callretry
, the component still fails intoonError
and doesn't reload as expected.Here is also a live example of a minimal reproduction: https://defineasynccomponent-issue.netlify.app/
Thank you for your help!
What is expected?
defineAsyncComponent
callonError
callback if it cant load component.defineAsyncComponent
reload component properly ifretry
function called and there is no any connecton problemsWhat is actually happening?
defineAsyncComponent
didnt reload component properly ifretry
function called and there is no any connecton problemsSystem Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: