Commit 8d163f9
committed
feat(express): enable esModuleInterop to align test and runtime
Enable esModuleInterop: true in modules/express/tsconfig.json
to fix CommonJS default-import interop at runtime.
Context:
Unit tests run via Mocha with tsx, which implicitly provides CJS
default-import interop. This allowed `import express from 'express'`
to work in tests.The Docker image runs the compiled CJS output without
that interop, causing TypeError: (0 , express_1. default) is not a function.
Enabling esModuleInterop makes the compiler emit CJS-compatible imports for CJS
modules like express, so tests and the Docker runtime execute the same semantics.
Notes:
Keeps behavior consistent across tsx tests and compiled production artifacts.
No API changes; build-time only.
TICKET: WP-57591 parent 7a63c5b commit 8d163f9
File tree
4 files changed
+4
-3
lines changed- modules/express
- src/enclavedExpressRoutes
- test/integration
4 files changed
+4
-3
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
0 commit comments