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

Include more information explaining that dynamic imports can fail #37453

Open
cesarandreu opened this issue Dec 31, 2024 · 0 comments
Open

Include more information explaining that dynamic imports can fail #37453

cesarandreu opened this issue Dec 31, 2024 · 0 comments
Labels
Content:JS JavaScript docs

Comments

@cesarandreu
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import

What specific section or headline is this issue about?

Return value

What information was incorrect, unhelpful, or incomplete?

I think it would be useful to mention that dynamic imports can fail if the user isn't connected to the internet. This is important for mobile users with spotty internet connections. Ideally it would be useful to document what kinds of errors different browsers return when a dynamic import request fails, and if it's possible to disambiguate between the server returning a 404 and the request failing because there's no internet connection.
Consider the use-case of an application that loads features dynamically as the user performs certain actions.

What did you expect to see?

Give an example of what happens if the user isn't connected to the internet when calling import(). Is the failure cached or can the developer just retry the request when the internet is back?

Actually, it would be very useful to document how caching impacts dynamic module imports as well.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@cesarandreu cesarandreu added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 31, 2024
@github-actions github-actions bot added the Content:JS JavaScript docs label Dec 31, 2024
@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
Projects
None yet
Development

No branches or pull requests

2 participants