Skip to content

Commit c607816

Browse files
fix: exports["."].require pointing at .js instead of the real .cjs build output (#1499)
Found while upgrading gasket packages in a downstream app: @gasket/plugin-docs and @gasket/plugin-intl's package.json exports maps declare `"require": "./cjs/index.js"`, but gasket-cjs only ever emits `./cjs/index.cjs` — the .js path never exists, so any CJS consumer (require('@gasket/plugin-docs')) gets MODULE_NOT_FOUND unconditionally. Swept every package in the monorepo for the same pattern (any exports condition ending in .js under a cjs/ path) and found 3 more instances of the identical copy/paste mistake: - @gasket/plugin-docs-graphs: both `require` and `default` wrong - @gasket/plugin-happyfeet: `require` wrong (its `default` was already correct) - @gasket/plugin-swagger: both the main export and the "./prompts" subpath export wrong All fixed to point at the .cjs file that actually exists. Same root-cause family as the gasket-plugin-switchboard fix in #2272. Co-authored-by: ssmith2-godaddy <>
1 parent 16cbc1d commit c607816

7 files changed

Lines changed: 22 additions & 8 deletions

File tree

.changeset/quiet-lemurs-jump.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@gasket/plugin-docs": patch
3+
"@gasket/plugin-intl": patch
4+
---
5+
6+
Fix `exports["."].require` pointing at a nonexistent `./cjs/index.js` in the published package — the real transpiled CJS entrypoint is `./cjs/index.cjs`. Any CJS consumer doing `require('@gasket/plugin-docs')` or `require('@gasket/plugin-intl')` got `MODULE_NOT_FOUND` unconditionally since the ESM port (7.5.0 / 7.6.0 respectively). Every sibling package (`@gasket/core`, `@gasket/intl`, `@gasket/nextjs`, `@gasket/plugin-webpack`, etc.) already points `require` at `./cjs/index.cjs`, and `@gasket/plugin-intl`'s own `default` condition in the same exports block already had the correct path — this brings `require` in line with it.

.changeset/three-eagles-hide.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"@gasket/plugin-docs-graphs": patch
3+
"@gasket/plugin-happyfeet": patch
4+
"@gasket/plugin-swagger": patch
5+
---
6+
7+
Fix `exports["."].require` (and, for `@gasket/plugin-swagger`, the `"./prompts"` subpath export too) pointing at a nonexistent `./cjs/*.js` path in the published package — the real transpiled CJS entrypoint is `./cjs/*.cjs`. Any CJS consumer got `MODULE_NOT_FOUND` unconditionally. Same bug class and fix as the `@gasket/plugin-docs` / `@gasket/plugin-intl` fix in this PR.

packages/gasket-plugin-docs-graphs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
".": {
1313
"types": "./lib/index.d.ts",
1414
"import": "./lib/index.js",
15-
"require": "./cjs/index.js",
16-
"default": "./cjs/index.js"
15+
"require": "./cjs/index.cjs",
16+
"default": "./cjs/index.cjs"
1717
},
1818
"./package.json": "./package.json"
1919
},

packages/gasket-plugin-docs/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
".": {
1515
"types": "./lib/index.d.ts",
1616
"import": "./lib/index.js",
17-
"require": "./cjs/index.js"
17+
"require": "./cjs/index.cjs",
18+
"default": "./cjs/index.cjs"
1819
},
1920
"./package.json": "./package.json"
2021
},

packages/gasket-plugin-happyfeet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
".": {
1515
"types": "./lib/index.d.ts",
1616
"import": "./lib/index.js",
17-
"require": "./cjs/index.js",
17+
"require": "./cjs/index.cjs",
1818
"default": "./cjs/index.cjs"
1919
},
2020
"./package.json": "./package.json"

packages/gasket-plugin-intl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
".": {
1515
"types": "./lib/index.d.ts",
1616
"import": "./lib/index.js",
17-
"require": "./cjs/index.js",
17+
"require": "./cjs/index.cjs",
1818
"default": "./cjs/index.cjs"
1919
},
2020
"./package.json": "./package.json"

packages/gasket-plugin-swagger/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
".": {
1414
"types": "./lib/index.d.ts",
1515
"import": "./lib/index.js",
16-
"require": "./cjs/index.js",
17-
"default": "./cjs/index.js"
16+
"require": "./cjs/index.cjs",
17+
"default": "./cjs/index.cjs"
1818
},
1919
"./prompts": {
2020
"import": "./lib/prompt.js",
21-
"require": "./cjs/prompt.js"
21+
"require": "./cjs/prompt.cjs"
2222
},
2323
"./package.json": "./package.json"
2424
},

0 commit comments

Comments
 (0)