Conversation
🦋 Changeset detectedLatest commit: 4b8254b The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Claude finished @punkbit's task in 1m 2s —— View job PR ReviewGood fix for a real ESM compatibility pain point with dayjs plugins! The approach of centralising plugin imports and adding ✅ Core approach is correct — dayjs plugins don't declare 💡 Suggestions (non-blocking)
Overall the PR is in good shape and achieves its stated goal. |
|
Claude finished @punkbit's task in 55s —— View job PR ReviewGood fix for a real ESM pain point — centralising dayjs plugin setup and adding explicit ✅ Core approach is correct — dayjs plugins don't declare 💡 Suggestions (non-blocking)
Overall the PR achieves its stated goal cleanly. ✅ |
📚 Storybook Preview Deployed✅ Preview URL: https://click-gp3m7pbpi-clickhouse.vercel.app Built from commit: |
…933) * refactor: 💡 move days to date utils to help enforce extension for ESM consumer imports * chore: 🤖 add note and TODO * chore: 🤖 add changeset
Why?
The Dayjs package/library doesn't declare exports for bare imports, causing ESM environments to look up for a filename with a missing file extension, e.g.
dayjs/plugin/advancedFormatinstead ofdayjs/plugin/advancedFormat.s.Other packages work without .js because they define exports Day.js plugins break because the maintainers do not declare exports.
For this reason, consolidated dayjs imports and plugin configuration into
src/utils/date.ts. Centralising these imports ensures consistent usage across components.How?
Preview?
Nextra (ESM, previously erroring):
Nextra server