Skip to content

Commit 28055c4

Browse files
committed
Fix CI: use bundler module resolution instead of ESM package type
The "type": "module" in package.json caused the CJS esbuild bundle to be parsed as ESM at runtime, breaking require() calls for Node.js built-ins. Instead, use moduleResolution: "bundler" in tsconfig which resolves ESM exports fields correctly while keeping the project as CJS. Revert jest.config.cjs back to jest.config.js. https://claude.ai/code/session_01QwnXfWH2ELHXvNgijYTeM1
1 parent 0de7c93 commit 28055c4

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed
File renamed without changes.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "4.0.0",
44
"private": true,
55
"description": "Compile SQL to type-safe Go",
6-
"type": "module",
76
"main": "lib/main.js",
87
"scripts": {
98
"build": "tsc",

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"compilerOptions": {
33
"target": "es2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
4-
"module": "node16", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
5-
"moduleResolution": "node16", /* Specify module resolution strategy. */
4+
"module": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
5+
"moduleResolution": "bundler", /* Specify module resolution strategy. */
66
"outDir": "./lib", /* Redirect output structure to the directory. */
77
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
88
"strict": true, /* Enable all strict type-checking options. */

0 commit comments

Comments
 (0)