fix(emcn): repair app-wide crash and unstyled UI after package extraction (#5258)

Two regressions from moving emcn into @sim/emcn:

1. optimizePackageImports['@sim/emcn'] rewrote barrel imports to direct subpaths, duplicating the toast module so ToastProvider (layout) and useToast (workspace permissions provider) resolved different ToastContext objects — useToast threw 'must be used within <ToastProvider>' on every workspace route. Removed @sim/emcn from optimizePackageImports.

2. emcn's source left apps/sim's Tailwind content globs (and docs' v4 auto-content scope, which excludes node_modules), so utility classes used only inside emcn components stopped generating and components rendered unstyled. Added the package to apps/sim's Tailwind content and a @source to docs.
This commit is contained in:
Waleed
2026-06-28 23:52:47 -07:00
committed by GitHub
parent bcf6a804f9
commit f5f87de96d
3 changed files with 2 additions and 1 deletions
+1
View File
@@ -2,6 +2,7 @@
@import "fumadocs-ui/css/neutral.css";
@import "fumadocs-ui/css/preset.css";
@import "fumadocs-openapi/css/preset.css";
@source "../../../packages/emcn/src";
/* Prevent overscroll bounce effect on the page */
html,
-1
View File
@@ -133,7 +133,6 @@ const nextConfig: NextConfig = {
optimizeCss: true,
preloadEntriesOnStart: false,
optimizePackageImports: [
'@sim/emcn',
'lodash',
'framer-motion',
'reactflow',
+1
View File
@@ -6,6 +6,7 @@ export default {
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}',
'../../packages/emcn/src/**/*.{js,ts,jsx,tsx}',
'!./app/node_modules/**',
'!**/node_modules/**',
],