Commit b72075f
fix: prevent @xenova/transformers from bundling in serverless functions
Resolve "Serverless Function exceeded 250 MB" error by:
- Using Next.js dynamic import with ssr:false for ResumeTranslator component
- Implementing lazy loading for @xenova/transformers library
- Ensuring transformer module only loads client-side in browser
- Added browser-only check to prevent server-side imports
Server bundle size reduced from 250MB+ to 16KB
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 0e8029d commit b72075f
2 files changed
+41
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
2 | 16 | | |
3 | | - | |
4 | | - | |
| 17 | + | |
| 18 | + | |
5 | 19 | | |
6 | 20 | | |
7 | 21 | | |
| |||
117 | 131 | | |
118 | 132 | | |
119 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
120 | 140 | | |
121 | 141 | | |
122 | 142 | | |
123 | | - | |
| 143 | + | |
124 | 144 | | |
125 | 145 | | |
126 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
9 | 25 | | |
10 | 26 | | |
11 | 27 | | |
| |||
0 commit comments