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(aio): add vite alias for @posthog/llm-normalizer (#82714)

Matt Pua2de2e1d7c234
diff --git a/frontend/vite.config.mts b/frontend/vite.config.mts
index 27e6c7064bfd..6c43b2e7d401 100644
--- a/frontend/vite.config.mts
+++ b/frontend/vite.config.mts
@@ -69,6 +69,12 @@ export default defineConfig(({ mode }) => {
public: resolve(__dirname, 'src/assets'),
// Required for production builds — @posthog/icons is in the pnpm store, not node_modules root
'@posthog/icons': resolve(__dirname, 'node_modules/@posthog/icons'),
+ // Source-only workspace package (exports map points at src/*.ts) — Vite can't resolve
+ // it by default when imported from products/*/frontend, like the @posthog/icons case above.
+ // Alias each export explicitly, subpath first: a lone package-root alias would rewrite the
+ // '@posthog/llm-normalizer/types' import to a nonexistent path instead of src/types.ts.
+ '@posthog/llm-normalizer/types': resolve(__dirname, 'node_modules/@posthog/llm-normalizer/src/types.ts'),
+ '@posthog/llm-normalizer': resolve(__dirname, 'node_modules/@posthog/llm-normalizer/src/index.ts'),
// These @tiptap packages live only in frontend/node_modules, which products/*/frontend
// files can't reach by walking up from their own directory. Alias each package
// individually: a blanket '@tiptap' prefix would also rewrite the imports *inside*