fix: correct ESM/CJS export paths for "type": "module" service packages#973
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
When tsup builds a package with "type": "module", it outputs: - ESM → dist/index.js (not .mjs) - CJS → dist/index.cjs (not .js) All 8 service packages had the wrong export paths (using .mjs/.js convention intended for packages WITHOUT "type": "module"), causing ERR_MODULE_NOT_FOUND on Vercel when importing @objectstack/service-feed. Fixes: service-feed, service-automation, service-cache, service-realtime, service-job, service-queue, service-storage, service-analytics. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/584d6e41-6f6f-493b-8c7b-7634aadaa08f
Copilot
AI
changed the title
[WIP] Fix Vercel module not found error in service-feed import
fix: correct ESM/CJS export paths for Mar 23, 2026
"type": "module" service packages
hotlong
marked this pull request as ready for review
March 23, 2026 13:19
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes Vercel ERR_MODULE_NOT_FOUND failures caused by incorrect package.json exports paths in "type": "module" service packages, aligning them with tsup’s actual ESM/CJS output filenames.
Changes:
- Updated
exportsmaps in eight service packages to useimport: ./dist/index.jsandrequire: ./dist/index.cjs. - Added a changelog entry documenting the Vercel deployment fix and listing affected packages.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/services/service-storage/package.json | Fix exports to match tsup output for "type": "module" (ESM .js, CJS .cjs). |
| packages/services/service-realtime/package.json | Fix exports to match tsup output for "type": "module" (ESM .js, CJS .cjs). |
| packages/services/service-queue/package.json | Fix exports to match tsup output for "type": "module" (ESM .js, CJS .cjs). |
| packages/services/service-job/package.json | Fix exports to match tsup output for "type": "module" (ESM .js, CJS .cjs). |
| packages/services/service-feed/package.json | Fix exports to resolve Vercel dist/index.mjs import failure. |
| packages/services/service-cache/package.json | Fix exports to match tsup output for "type": "module" (ESM .js, CJS .cjs). |
| packages/services/service-automation/package.json | Fix exports to match tsup output for "type": "module" (ESM .js, CJS .cjs). |
| packages/services/service-analytics/package.json | Fix exports to match tsup output for "type": "module" (ESM .js, CJS .cjs). |
| CHANGELOG.md | Document the Vercel ERR_MODULE_NOT_FOUND fix and affected packages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vercel deploys fail with
ERR_MODULE_NOT_FOUNDfor@objectstack/service-feed/dist/index.mjsbecause the file doesn't exist.When
tsupbuilds a"type": "module"package, it emitsdist/index.js(ESM) anddist/index.cjs(CJS). Eight service packages had their exports pointing to.mjs/.js— the convention for packages without"type": "module":Packages like
core,runtime,rest, andservice-i18nalready had the correct paths — this aligns the remaining eight:service-feed← the specific Vercel failureservice-automationservice-cacheservice-realtimeservice-jobservice-queueservice-storageservice-analyticsOriginal prompt
📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.