Skip to content

Fix issue with importing CheckBoxTree component#9973

Open
KijongHan wants to merge 1 commit into
pgadmin-org:masterfrom
KijongHan:fix/react-checkbox-tree-import-module
Open

Fix issue with importing CheckBoxTree component#9973
KijongHan wants to merge 1 commit into
pgadmin-org:masterfrom
KijongHan:fix/react-checkbox-tree-import-module

Conversation

@KijongHan
Copy link
Copy Markdown
Contributor

@KijongHan KijongHan commented May 23, 2026

Resolves issue #9972

What does this PR do?

The react-checkbox-tree v2 release added "type": "module" to its package.json, which made webpack treat its UMD bundle (lib/index.js) as ESM and ignore the module.exports assignment. This means that importing the component yielded undefined and crashed the tree views. Aliasing the package to its true ESM entry (lib/index.esm.js) makes webpack read the proper export statements and restores the component.

Summary of changes

add forced routing to underlying esm module declaration when importing from react-checkbox-tree

Summary by CodeRabbit

  • Bug Fixes
    • Updated webpack module resolution configuration for the checkbox tree component to ensure correct import handling.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2651948f-392d-4a37-b1e1-96cacf483145

📥 Commits

Reviewing files that changed from the base of the PR and between 533aed1 and bbda33e.

📒 Files selected for processing (1)
  • web/webpack.shim.js

Walkthrough

Webpack configuration is updated to explicitly alias react-checkbox-tree to its ESM entry point (lib/index.esm.js) instead of allowing default resolution. The change includes inline comments explaining that recent type: "module" changes in the dependency cause webpack to incorrectly handle the UMD entry, necessitating the direct ESM alias.

Changes

Webpack Alias Configuration

Layer / File(s) Summary
Webpack ESM alias for react-checkbox-tree
web/webpack.shim.js
Webpack resolveAlias configuration is added to force react-checkbox-tree to resolve to its ESM build file (lib/index.esm.js). Explanatory comments document that recent type: "module" changes in the dependency cause webpack to mishandle the UMD entry, so the ESM file is explicitly aliased.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix issue with importing CheckBoxTree component' directly and clearly describes the main change—resolving an import issue with the react-checkbox-tree component by aliasing it to its ESM entry.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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