Skip to content

fix: copy package.json to dist/ for version.ts#44

Closed
tauagent wants to merge 1 commit intomainfrom
fix/copy-package-json-to-dist
Closed

fix: copy package.json to dist/ for version.ts#44
tauagent wants to merge 1 commit intomainfrom
fix/copy-package-json-to-dist

Conversation

@tauagent
Copy link
Copy Markdown
Collaborator

Problem

The 0.3.31 Docker image crashes with:

Error: ENOENT: no such file or directory, open '/app/dist/package.json'

Cause

The version.ts file (added in #42) reads package.json relative to __dirname:

readFileSync(join(__dirname, '../package.json'), 'utf-8')

When bundled with tsup, __dirname resolves to /app/dist, so it looks for /app/dist/../package.json which should work... but tsup's bundling changes path resolution.

Fix

Copy package.json to dist/ after building so it's available at runtime.

The version.ts file reads package.json relative to __dirname.
When bundled with tsup, this resolves to dist/package.json
but only package.json in root was being copied.
@tauagent tauagent requested a review from noahsaso as a code owner April 14, 2026 14:18
@tauagent
Copy link
Copy Markdown
Collaborator Author

Closing in favor of a cleaner fix using process.cwd()

@tauagent tauagent closed this Apr 14, 2026
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.

1 participant