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

Image "sizes" prop breaks older browsers becuse String.prototype.matchAll is not polyfilled #24862

Closed
skrivanos opened this issue May 6, 2021 · 4 comments
Labels
bug Issue was opened via the bug report template.

Comments

@skrivanos
Copy link

skrivanos commented May 6, 2021

What version of Next.js are you using?

10.2.0

What version of Node.js are you using?

14

What browser are you using?

Firefox 55

What operating system are you using?

MacOS

How are you deploying your application?

Other

Describe the Bug

Seeing this error in production from older browsers:

n.matchAll is not a function. (In 'n.matchAll(/(^|\s)(1?\d?\d)vw/g)', 'n.matchAll' is undefined)

next/image uses String.prototype.matchAll and which does not seem to get polyfilled correctly. This means that using the "sizes" prop breaks the application for older browsers.

Expected Behavior

Polyfill String.prototype.matchAll

To Reproduce

https://github.com/skrivanos/next-image-matchall-repro

yarn build && yarn start

browse to index with for instance ie11 or firefox 55. Voila!

@skrivanos skrivanos added the bug Issue was opened via the bug report template. label May 6, 2021
@timneutkens
Copy link
Member

Handled by #24569 which is currently on canary.

@skrivanos
Copy link
Author

skrivanos commented May 6, 2021

@timneutkens thanks - looks like Google failed me. Sorry for the trouble.

@Grsmto
Copy link

Grsmto commented May 10, 2021

For SEO purpose I leave this here:
It also break the build if you're using Node < 12.0 since matchAll was added to Node only from 12.0.0.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

4 participants