Skip to content

Commit a25410a

Browse files
authored
Merge pull request #436 from objectstack-ai/copilot/fix-whatwg-url-module-error
2 parents 0b7051f + f270518 commit a25410a

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
### Fixed
2222

23+
- **`apps/demo`** — added `whatwg-url`, `tr46`, and `webidl-conversions` as explicit devDependencies and to `vercel.json` `includeFiles`. These are transitive dependencies of `node-fetch@2.7.0` (used by `cross-fetch@4.1.0`) that must be bundled into Vercel's serverless function. Without them, the deployment fails with `Cannot find module 'whatwg-url/index.js'`.
2324
- **`apps/demo/scripts/patch-symlinks.cjs`** — enhanced to automatically resolve and copy ALL transitive dependencies before dereferencing symlinks. Previously, only direct dependencies listed in `apps/demo/package.json` were available after symlink dereferencing, causing `ERR_MODULE_NOT_FOUND` for transitive deps like `@objectstack/rest`, `zod`, `pino`, `better-auth`, etc. The script now walks each package's pnpm virtual store context (`.pnpm/<name>@<ver>/node_modules/`) and copies any missing sibling dependency into the top-level `node_modules/`, repeating until the full transitive closure is present.
2425
- **`apps/demo`** — added explicit `@objectstack/spec` and `zod` devDependencies as defense-in-depth for Vercel deployment.
2526
- **`@objectql/types`** — moved `@objectstack/spec` and `zod` from `devDependencies` to `dependencies`. The compiled JS output contains runtime imports of `@objectstack/spec` (via `z.infer<typeof Data.X>` patterns), so they must be declared as production dependencies.

apps/demo/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"ws": "^8.19.0",
5252
"cross-fetch": "^4.1.0",
5353
"node-fetch": "^2.7.0",
54+
"whatwg-url": "^5.0.0",
55+
"tr46": "^0.0.3",
56+
"webidl-conversions": "^3.0.1",
5457
"zod": "^4.3.6"
5558
},
5659
"engines": {

apps/demo/vercel.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"api/**/*.ts": {
88
"memory": 1024,
99
"maxDuration": 60,
10-
"includeFiles": "node_modules/{@object-ui/*/dist,@objectstack/*/dist,@objectql/*/dist,@libsql,@neon-rs,libsql,detect-libc,js-base64,promise-limit,nanoid,ws,cross-fetch,node-fetch}/**"
10+
"includeFiles": "node_modules/{@object-ui/*/dist,@objectstack/*/dist,@objectql/*/dist,@libsql,@neon-rs,libsql,detect-libc,js-base64,promise-limit,nanoid,ws,cross-fetch,node-fetch,whatwg-url,tr46,webidl-conversions}/**"
1111
}
1212
},
1313
"rewrites": [

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)