vercel / next.js

The React Framework
https://nextjs.org
MIT License
125.26k stars 26.77k forks source link

IE11 polyfills: missing Math.trunc #11714

Closed ebidel closed 1 year ago

ebidel commented 4 years ago

Bug report

Describe the bug

Math.trunc is not available in IE11. Seeing errors show up in bugsnag for this one.

Expected behavior

Math.trunc should be polyfilled in the IE11 polyfill bundle.

System information

timneutkens commented 4 years ago

Math polyfills were excluded on purpose as it seemed like something only few applications would use them 🤔

Timer commented 4 years ago

More context: we agreed that we could polyfill these Math function(s), but only when used. More than happy to take a PR!

ebidel commented 4 years ago

Makes sense not to add APIs which aren't universally applicable to all next users. We can polyfill on our end.

Happy to submit a PR, but maybe a large question is how do you all think about prioritizing one-off polyfill additions like this?

iduuck commented 4 years ago

@Timer Is there any specific help I could give you on this use case? I am more than eager to submit a PR, but currently I don't know, if there is also a way to implement such polyfills, and where to look first for implementing this?

SarKurd commented 4 years ago

@iDuuck i think that's the place to add the polyfills, just need to import Math polyfills from Corejs https://github.com/zeit/next.js/blob/canary/packages/next-polyfill-nomodule/src/index.js

After they published then need another PR to upgrade @next/polyfill-nomodule in Next package

I might be wrong.

iduuck commented 4 years ago

Thank you, @SarKurd. Next question would be, how they want it to be implemented. At the moment, it would be the easiest, to just set an environment variable and call the import conditionally in the next-polyfill-nomodule package. But as I know the Next.js team, I think, they want something to specify in the next.config.js.

Will have a look at the code.

SarKurd commented 4 years ago

Sorry i'm not sure. I would just create another file in next-polyfill-nomodule for math polyfills and in Next package would accept another property in next.config.js but it might complicate things and not necessary. might better to wait for their reply

iduuck commented 4 years ago

So, I cannot find any reference in the actual Next.js source code to next-polyfill-nomodule. Is it even loaded into the code by default? (Link to search).

I quickly wanted to create a PR, since it's not that much of an issue as I understand. But this confused me.

SarKurd commented 4 years ago

it's @next/polyfill-nomodule https://github.com/zeit/next.js/search?q=next%2Fpolyfill-nomodule&unscoped_q=next%2Fpolyfill-nomodule

And loaded here https://github.com/zeit/next.js/blob/b88f20c90bf4659b8ad5cb2a27956005eac2c7e8/packages/next/client/polyfills.js

iduuck commented 4 years ago

Never been that confused lately. Thanks for clarification! All clear now.

github-actions[bot] commented 1 year ago

Please verify that your issue can be recreated with next@canary.

Why was this issue marked with the please verify canary label?

We noticed the provided reproduction was using an older version of Next.js, instead of canary.

The canary version of Next.js ships daily and includes all features and fixes that have not been released to the stable version yet. You can think of canary as a public beta. Some issues may already be fixed in the canary version, so please verify that your issue reproduces by running npm install next@canary and test it in your project, using your reproduction steps.

If the issue does not reproduce with the canary version, then it has already been fixed and this issue can be closed.

How can I quickly verify if my issue has been fixed in canary?

The safest way is to install next@canary in your project and test it, but you can also search through closed Next.js issues for duplicates or check the Next.js releases.

My issue has been open for a long time, why do I need to verify canary now?

Next.js does not backport bug fixes to older versions of Next.js. Instead, we are trying to introduce only a minimal amount of breaking changes between major releases.

What happens if I don't verify against the canary version of Next.js?

An issue with the please verify canary that receives no meaningful activity (e.g. new comments that acknowledge verification against canary) will be automatically closed and locked after 30 days.

If your issue has not been resolved in that time and it has been closed/locked, please open a new issue, with the required reproduction, using next@canary.

I did not open this issue, but it is relevant to me, what can I do to help?

Anyone experiencing the same issue is welcome to provide a minimal reproduction following the above steps. Furthermore, you can upvote the issue using the :+1: reaction on the topmost comment (please do not comment "I have the same issue" without repro steps). Then, we can sort issues by votes to prioritize.

I think my reproduction is good enough, why aren't you looking into it quicker?

We look into every Next.js issue and constantly monitor open issues for new comments.

However, sometimes we might miss one or two due to the popularity/high traffic of the repository. We apologize, and kindly ask you to refrain from tagging core maintainers, as that will usually not result in increased priority.

Upvoting issues to show your interest will help us prioritize and address them as quickly as possible. That said, every issue is important to us, and if an issue gets closed by accident, we encourage you to open a new one linking to the old issue and we will look into it.

Useful Resources

balazsorban44 commented 1 year ago

This issue has been automatically closed because it wasn't verified against next@canary. If you think it was closed by accident, please leave a comment. If you are running into a similar issue, please open a new issue with a reproduction. Thank you.

github-actions[bot] commented 1 year ago

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.