fix: GitHub Action bundle fix - Remove Probot type definitions#20
Merged
Conversation
Fix GitHub Actions workflow failure caused by missing dependencies (express, probot, etc.). The bundled dist/index.js now includes all dependencies (4.1MB) so the action can run without npm install. Changes: - Rebuilt dist/index.js with ncc bundler (4.1MB with all deps) - Removed dist/index.js.map (not needed for bundled action) - Updated type definitions Fixes: ERR_MODULE_NOT_FOUND for express package in GitHub Actions Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The dist/index.d.ts file contained type definitions for the Probot app (src/index.ts) which import 'express'. When the GitHub Action runs, Node.js tries to load this file alongside dist/index.js, causing ERR_MODULE_NOT_FOUND. The GitHub Action (dist/index.js) should not have type definitions alongside it - it's a bundled executable, not a library. Fix: Delete dist/index.d.ts to prevent Node.js from attempting to load the Probot app's type definitions when running the GitHub Action. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Fix GitHub Actions workflow failure by removing the Probot type definition file (
dist/index.d.ts) that was causingERR_MODULE_NOT_FOUNDfor express.Problem
The GitHub Action was failing with:
Root Cause
The
dist/index.d.tsfile contained TypeScript type definitions for the Probot app (src/index.ts), which import 'express'. When the GitHub Action runs, Node.js tries to load this file alongsidedist/index.js, causing the module resolution error.Solution
dist/index.d.ts- The GitHub Action bundle should not have type definitions alongside it, as it's a bundled executable, not a librarydist/index.js(4.1MB) already contains all necessary code fromsrc/action.tsTesting
Related Changes
This PR also includes the previously merged work:
🤖 Generated with Claude Code