vercel / vercel/next.js

Docs: polyfills and supported browsers

Open
#63,469 2 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

What is the improvement or update you wish to see?

Next.js supports modern browsers with zero configuration.

The NextJS documentation is very unclear about the browser support and how polyfills work. Reading it without understanding how they are applied makes you believe that there is no configuration needed for the mentioned browser list to be polyfilled and work.

We inject widely used polyfills, including:

The link in above goes to the next-polyfill-nomodule which adds the polyfills by noModule property in the script tag. The attribute is set to indicate that the script should not be executed in browsers that support ES modules

Is there any context that might help us understand?

With the current solution it means that no browser with support for ES modules will use the (nomodule) polyfill file. As an example chrome got support for ES modules in version 61, while it did not get support for Promise.allSettled until version 76, that means that any chrome version above 61 won't get polyfilled.

The documentation is at minimum very misleading and potentially can be considered a bug. It seems like the polyfills that are in the nomodules file were made for IE11.

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/architecture/supported-browsers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supported browsers documentation at https://nextjs.org/docs/architecture/supported-browsers and inspect the linked packages/next-polyfill-nomodule/src/index.js. Verify how the noModule polyfill behavior relates to the browser list and ES module support. Done means the documentation clearly explains which browsers are supported, how polyfills are applied, and what configuration is required.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.