Commit 813af11
fix: resolve Buffer.alloc error in production build
Root cause: ES module imports are hoisted and execute before module body code.
When vendor-ton was a separate chunk, it would load and execute before the
Buffer polyfill in the main bundle, causing "Buffer.alloc is not a function".
Solution: Remove vendor-ton from manualChunks to keep TON packages in the main
bundle with the Buffer polyfill, ensuring correct execution order.
Changes:
- Remove vendor-ton manual chunk from vite.config.ts
- Keep TON packages in main bundle alongside Buffer polyfill
- Add explicit globalThis.Buffer setup in polyfills.ts for extra safety
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent fdd3fee commit 813af11
File tree
9 files changed
+1297
-1285
lines changed- dist
- assets
- src
9 files changed
+1297
-1285
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
This file was deleted.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
This file was deleted.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
75 | | - | |
| 74 | + | |
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
| |||
0 commit comments