You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHROMATIC_ISSUE_SUMMARY.md
+17-5Lines changed: 17 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
# Chromatic Build Issue Summary
2
2
3
3
## Problem
4
+
4
5
Storybook builds locally but fails in Chromatic with error:
6
+
5
7
```
6
8
TypeError: a is not a function
7
9
at https://68e30fca49979473fc9abc73-...chromatic.com/assets/AssistantMessage.stories-...js:6:11
@@ -10,60 +12,71 @@ at https://68e30fca49979473fc9abc73-...chromatic.com/assets/AssistantMessage.sto
10
12
This is the minified version of `styled is not a function` - @emotion/styled's default export isn't being resolved correctly in Chromatic's build environment.
11
13
12
14
## Root Cause
15
+
13
16
Almost every component in the project uses `@emotion/styled` (25+ files). The issue appears to be a module resolution problem specific to Chromatic's infrastructure where the default export from @emotion/styled becomes undefined in the production build.
- Only include stories for components that don't use styled
50
60
- Or create simplified versions of components for Storybook only
51
61
- Pros: Gets some stories working in Chromatic
52
62
- Cons: Limited coverage
53
63
54
64
## Recommendation
65
+
55
66
**Option 3** (Skip Chromatic for now) + document the issue for later investigation.
56
67
57
68
The emotion/styled issue appears to be environmental (Chromatic-specific) rather than a code problem. Local Storybook works fine for development. Visual regression testing can be added back once the root cause is identified.
58
69
59
70
## Files Modified
71
+
60
72
-`.storybook/main.ts` - Added dedupe config
61
73
-`src/components/tools/BashToolCall.tsx` - Converted to CSS modules
62
74
-`src/components/tools/FileReadToolCall.tsx` - Converted to CSS modules
63
75
-`src/components/tools/shared/ToolPrimitives.tsx` - Converted to CSS modules
- Reason: `@emotion/styled` module resolution failure in Chromatic environment
18
21
- Error: `TypeError: a is not a function` (styled is not a function)
19
22
20
23
## Investigation Summary
24
+
21
25
Spent significant time investigating the Chromatic build failure:
26
+
22
27
- Converted 2 components to CSS modules (BashToolCall, FileReadToolCall)
23
28
- Tried multiple Vite/Babel configurations
24
29
- Added dedupe config for emotion packages
25
-
- None resolved the Chromatic-specific issue
30
+
- Added compatibility shim `src/styles/styled.ts` to normalize default export usage across the app
31
+
- None resolved the Chromatic-specific issue yet (pending new Chromatic run with shim)
26
32
27
33
## Root Cause
34
+
28
35
The `@emotion/styled` default export becomes undefined in Chromatic's production build environment. This affects 25+ components across the codebase, not just the new Storybook stories.
29
36
30
37
## Decision Needed
38
+
31
39
See `CHROMATIC_ISSUE_SUMMARY.md` for detailed options analysis.
32
40
33
41
**Quick options:**
42
+
34
43
1.**Merge as-is** - Storybook works locally, accept Chromatic failure for now
35
44
2.**Disable Chromatic** - Remove workflow temporarily, re-enable after fix
36
45
3.**Continue conversion** - Convert all 25+ components to CSS modules (10-20 hours)
37
46
4.**Open support ticket** - Contact Chromatic team for help
38
47
39
48
## Recommendation
49
+
40
50
**Option 1 or 2** - The Storybook feature is complete and working. The Chromatic issue is environmental and affects the entire codebase, not specific to this PR. It should be addressed separately.
41
51
42
52
The stories provide value for local development even without Chromatic visual regression testing.
0 commit comments