Skip to content

fix(demo): add whatwg-url transitive deps to Vercel bundle#436

Merged
hotlong merged 2 commits intomainfrom
copilot/fix-whatwg-url-module-error
Mar 22, 2026
Merged

fix(demo): add whatwg-url transitive deps to Vercel bundle#436
hotlong merged 2 commits intomainfrom
copilot/fix-whatwg-url-module-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

Vercel deployment crashes with Cannot find module 'whatwg-url/index.js' — transitive deps of node-fetch@2.7.0 (via cross-fetch) were missing from the serverless function bundle.

Dependency chain: cross-fetchnode-fetch@2.7.0whatwg-url@5.0.0tr46, webidl-conversions

Changes

  • apps/demo/vercel.json — add whatwg-url, tr46, webidl-conversions to includeFiles glob
  • apps/demo/package.json — declare all three as explicit devDependencies so they're hoisted to top-level node_modules/
  • CHANGELOG.md — document fix
Original prompt

2026-03-22 04:43:34.843 [error] Cannot find module '/var/task/apps/demo/node_modules/whatwg-url/index.js'. Please verify that the package.json has a valid "main" entry
Did you forget to add it to "dependencies" in package.json?
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.
Cannot find module '/var/task/apps/demo/node_modules/whatwg-url/index.js'. Please verify that the package.json has a valid "main" entry
Did you forget to add it to "dependencies" in package.json?
Node.js process exited with exit status: 1. The logs above can help with debugging the issue.


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectql-demo Ready Ready Preview, Comment Mar 22, 2026 4:50am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectql Ignored Ignored Mar 22, 2026 4:50am

Request Review

…ent bundle

Transitive dependencies of node-fetch@2.7.0 (via cross-fetch@4.1.0) were
missing from vercel.json includeFiles and not declared as explicit
devDependencies. This caused the Vercel serverless function to fail at
runtime with 'Cannot find module whatwg-url/index.js'.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Agent-Logs-Url: https://github.com/objectstack-ai/objectql/sessions/5ec52906-e8f4-45a1-b5f5-2b16ac0d19c6
Copilot AI changed the title [WIP] Fix error loading whatwg-url module in demo app fix(demo): add whatwg-url transitive deps to Vercel bundle Mar 22, 2026
Copilot AI requested a review from hotlong March 22, 2026 04:51
@hotlong hotlong marked this pull request as ready for review March 22, 2026 05:05
Copilot AI review requested due to automatic review settings March 22, 2026 05:05
@hotlong hotlong merged commit a25410a into main Mar 22, 2026
6 checks passed
@hotlong hotlong deleted the copilot/fix-whatwg-url-module-error branch March 22, 2026 05:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the apps/demo Vercel serverless deployment crash caused by missing node-fetch@2.7.0 transitive dependencies in the bundled function output, by explicitly hoisting and bundling the required packages.

Changes:

  • Add whatwg-url, tr46, and webidl-conversions as explicit devDependencies for apps/demo (and lockfile updates).
  • Extend apps/demo/vercel.json includeFiles to ensure those packages are included in the serverless bundle.
  • Document the deployment fix in CHANGELOG.md.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
pnpm-lock.yaml Locks the newly added apps/demo devDependencies (whatwg-url, tr46, webidl-conversions).
CHANGELOG.md Adds an Unreleased “Fixed” entry documenting the Vercel bundling fix and the underlying dependency chain.
apps/demo/vercel.json Updates includeFiles to bundle the newly added transitive dependency packages.
apps/demo/package.json Adds the three packages as explicit devDependencies to ensure they are present at the top-level node_modules/ for bundling.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants