Commit 3375d3d
fix(core): vendor superjson to fix CJS compatibility issue
This fixes the ERR_REQUIRE_ESM error that occurs when using @trigger.dev/core
in CJS environments with Node.js versions < 22.12. The superjson package (v2.x)
is ESM-only, but Node.js doesn't support require() of ESM modules in older
versions.
The fix bundles superjson@2.2.1 using esbuild into both CJS and ESM formats,
which are then imported by the existing wrapper modules. This ensures the
package works correctly in all environments without relying on Node.js's
experimental require(ESM) feature.
Fixes #2937
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 4093883 commit 3375d3d
File tree
5 files changed
+1653
-10
lines changed- .changeset
- packages/core/src/v3
- imports
- vendor
5 files changed
+1653
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
4 | | - | |
5 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
6 | 17 | | |
7 | 18 | | |
8 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
3 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
4 | 14 | | |
5 | 15 | | |
6 | | - | |
7 | | - | |
8 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
9 | 19 | | |
10 | 20 | | |
11 | 21 | | |
12 | 22 | | |
13 | | - | |
14 | 23 | | |
0 commit comments