Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(quill-charts): load the built package in plain node esm (#125541)

Ben White94f2e1e32f1b
diff --git a/packages/quill/packages/charts/package.json b/packages/quill/packages/charts/package.json
index cc5f847a206d..05868d03e083 100644
--- a/packages/quill/packages/charts/package.json
+++ b/packages/quill/packages/charts/package.json
@@ -35,7 +35,8 @@
"access": "public"
},
"scripts": {
- "build": "vite build"
+ "build": "vite build && pnpm check:node-import",
+ "check:node-import": "node --input-type=module -e \"await import('./dist/index.js'); await import('./dist/testing.js')\" && node -e \"require('./dist/index.cjs'); require('./dist/testing.cjs')\""
},
"dependencies": {
"@floating-ui/react": "^0.27.19",
diff --git a/packages/quill/packages/charts/src/utils/dayjs.ts b/packages/quill/packages/charts/src/utils/dayjs.ts
index da5b9410a389..9bd2ebef1d87 100644
--- a/packages/quill/packages/charts/src/utils/dayjs.ts
+++ b/packages/quill/packages/charts/src/utils/dayjs.ts
@@ -5,9 +5,9 @@
// oxlint-disable-next-line no-restricted-imports
import dayjs, { Dayjs as DayjsOriginal } from 'dayjs'
-import customParseFormat from 'dayjs/plugin/customParseFormat'
-import timezone from 'dayjs/plugin/timezone'
-import utc from 'dayjs/plugin/utc'
+import customParseFormat from 'dayjs/plugin/customParseFormat.js'
+import timezone from 'dayjs/plugin/timezone.js'
+import utc from 'dayjs/plugin/utc.js'
dayjs.extend(customParseFormat)
dayjs.extend(utc)