Skip to content

fix: add core-js polyfill for babel preset-env useBuiltIns#7727

Open
wtfiwtz wants to merge 2 commits into
getredash:masterfrom
orchestrated-io:fix/frontend-core-js-polyfill
Open

fix: add core-js polyfill for babel preset-env useBuiltIns#7727
wtfiwtz wants to merge 2 commits into
getredash:masterfrom
orchestrated-io:fix/frontend-core-js-polyfill

Conversation

@wtfiwtz
Copy link
Copy Markdown

@wtfiwtz wtfiwtz commented Jun 2, 2026

What type of PR is this?

  • Bug Fix

Description

Add core-js@^2.6.12 as a devDependency to satisfy @babel/preset-env's useBuiltIns: "usage" configuration with corejs: 2.

This resolves build-time polyfill import errors where Babel injects import 'core-js/modules/...' statements but the package is not installed.

The babel config (client/.babelrc.js) uses:

  • useBuiltIns: "usage" - automatically imports polyfills based on code usage
  • corejs: 2 - targets core-js version 2.x

Without core-js installed, the frontend build and Jest tests fail with "Cannot find module 'core-js/modules/es6.symbol.js'" errors.

Note: core-js@2 is EOL. A future migration to core-js@3 is recommended, but requires updating the babel config and is out of scope for this fix.

How is this tested?

  • Unit tests (Jest) - all 15 test suites pass with core-js installed

Related Tickets & Documents

Split from #7718 per @zachliu's review feedback to separate frontend build dependency additions from Dockerfile infrastructure changes.

Part of the security vulnerability remediation work tracked in #7711.

Note

This PR is marked as draft until manual container testing is complete.

Made with Cursor

wtfiwtz and others added 2 commits June 2, 2026 10:07
Add core-js@^2.6.12 as a devDependency to satisfy @babel/preset-env's
useBuiltIns: "usage" configuration with corejs: 2.

This resolves build-time polyfill import errors where Babel injects
`import 'core-js/modules/...'` statements but the package is not installed.

The babel config (client/.babelrc.js) uses:
- useBuiltIns: "usage" - automatically imports polyfills based on code usage
- corejs: 2 - targets core-js version 2.x

Without core-js installed, the frontend build and Jest tests fail with
"Cannot find module 'core-js/modules/es6.symbol.js'" errors.

Note: core-js@2 is EOL. A future migration to core-js@3 is recommended,
but requires updating the babel config and is out of scope for this fix.

Related: split from getredash#7718
Co-authored-by: Cursor <cursoragent@cursor.com>
@wtfiwtz wtfiwtz marked this pull request as ready for review June 2, 2026 23:30
@wtfiwtz
Copy link
Copy Markdown
Author

wtfiwtz commented Jun 2, 2026

This one is essential! It's been added to just about every other PR I've added here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant