Runtime polyfills missing due to core‑js version mismatch in Babel 7 preset‑env
0 reputation · 23 Jul 2021, 09:11 UTC
When Babel 7 preset‑env is configured with useBuiltIns: 'usage', the transformation relies on core‑js to inject polyfills for newly added built‑ins.
If the core‑js package is absent or its major version does not match the preset‑env expectation (e.g., v2 vs v3), the generated code may lack polyfills for APIs such as Promise or Array.prototype.flat, causing runtime errors in browsers listed in browserslist.
What specific core‑js version requirement does preset‑env enforce for reliable polyfill injection? Does a mismatch between core‑js v2 and the current preset‑env lead to silent omission of modern built‑in polyfills? How can the configuration be verified to ensure that all required built‑ins are included?