fix: migrate lodash to lodash-es for ESM compatibility#66
Conversation
Replace lodash with lodash-es for proper ESM exports. Fixes "does not provide an export named 'default'" error in Vite dev. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR migrates the Chronicle package from CommonJS lodash to ESM lodash-es. Package dependencies and type definitions are updated in package.json, then import statements in two source files are converted to use the ESM build's named exports. ChangesLodash to lodash-es migration
🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/chronicle/package.json (1)
26-26: 💤 Low valueConsider aligning
@types/lodash-esversion with lodash-es.The type definitions are at version
4.17.12while the implementation is at4.17.23. While lodash's API is stable and this mismatch is unlikely to cause issues, aligning the versions ensures full type coverage for any newer features or fixes.📦 Suggested version alignment
Check if
@types/lodash-eshas a version closer to 4.17.23:- "@types/lodash-es": "^4.17.12", + "@types/lodash-es": "^4.17.21",Note: Verify the latest available
@types/lodash-esversion on npm before updating.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/chronicle/package.json` at line 26, Update the `@types/lodash-es` dependency in package.json to match the lodash-es implementation version: locate the "@types/lodash-es" entry and change its version from "4.17.12" to a version aligned with "lodash-es" (e.g., "4.17.23" or the closest available on npm); verify the exact latest compatible `@types/lodash-es` version on npm first, update the package.json entry, and run your package manager (npm/yarn/pnpm) to reinstall and ensure no type regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/chronicle/package.json`:
- Line 26: Update the `@types/lodash-es` dependency in package.json to match the
lodash-es implementation version: locate the "@types/lodash-es" entry and change
its version from "4.17.12" to a version aligned with "lodash-es" (e.g.,
"4.17.23" or the closest available on npm); verify the exact latest compatible
`@types/lodash-es` version on npm first, update the package.json entry, and run
your package manager (npm/yarn/pnpm) to reinstall and ensure no type
regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b065e43c-e83e-42a8-a4f4-77b06f61dd29
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
packages/chronicle/package.jsonpackages/chronicle/src/components/ui/search.tsxpackages/chronicle/src/types/config.ts
Summary
lodashwithlodash-esfor proper ESM module exportsdoes not provide an export named 'default'error in Vite dev@types/lodashto@types/lodash-esTest plan
bun run dev:examples:basic— no import errors🤖 Generated with Claude Code