Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #8875
Closed
Open
Issue created Apr 22, 2020 by Administrator@rootContributor

Stable ES features are not always polyfilled when needed

Created by: skoging

Describe the bug

Even with import 'react-app-polyfill/stable', some stable ES features are not polyfilled, such as String#matchAll.

Even importing String#matchAll directly from core-js does not work: import 'core-js/stable/string/match-all'

https://caniuse.com/#feat=mdn-javascript_builtins_string_matchall

Steps to reproduce

(Write your steps here:)

yarn create react-app polyfill-bug
cd polyfill-bug
yarn add react-app-polyfill
// index.js
import 'react-app-polyfill/ie11'
import 'react-app-polyfill/stable'
import 'core-js/stable/string/match-all'

const matches = 'some test string'.matchAll(/s(.)/g);
// IE11 or Safari:
// Error: Object doesn't support property or method 'matchAll'

console.log(Array.from(matches))
// [["te", "e"], ["t ", " "], ["tr", "r"]]

Expected behavior

Polyfill for stable ES features should be part of the bundle when importing react-app-polyfill/stable.

In the case it isn't, explicitly importing the polyfill for the feature should work.

Assignee
Assign to
Time tracking