@actions/core 3.x and @actions/github 9.x are ESM-only: their exports maps expose only an import condition. Our build is CommonJS (tsconfig module: commonjs, ncc emits CJS), so webpack fails with
"." is not exported under the conditions ["require","node","production"] from package @actions/core
and skipLibCheck does not help — it is a bundling constraint, not a type-checking one. #123 therefore landed on the last CommonJS majors (@actions/github 8.0.1, @actions/core 2.0.3), which are current-generation in every other respect (octokit core 7, http-client 3, undici 6).
To go further the action itself needs to become ESM:
package.json "type": "module"; tsconfig module/moduleResolution → nodenext
- Replace the 26
import type { Context } from '@actions/github/lib/context' (subpath not in the v9 exports map) with a local alias such as type Context = typeof github.context, and WebhookPayload with typeof github.context.payload
__tests__/testUtils.ts MockContext extends Context needs the class via github.context.constructor
__tests__/bundle/runBundle.ts uses __dirname → import.meta.dirname
- Confirm ncc emits an ESM bundle and
action.yml (node24) runs dist/index.js as ESM given the root package.json type
- Re-run the bundle harness; check for
webpackMissingModule
Dependabot will keep proposing the v3/v9 bumps; close them referencing this issue until it is done.
@actions/core3.x and@actions/github9.x are ESM-only: theirexportsmaps expose only animportcondition. Our build is CommonJS (tsconfigmodule: commonjs, ncc emits CJS), so webpack fails withand
skipLibCheckdoes not help — it is a bundling constraint, not a type-checking one. #123 therefore landed on the last CommonJS majors (@actions/github8.0.1,@actions/core2.0.3), which are current-generation in every other respect (octokit core 7, http-client 3, undici 6).To go further the action itself needs to become ESM:
package.json"type": "module";tsconfigmodule/moduleResolution→nodenextimport type { Context } from '@actions/github/lib/context'(subpath not in the v9 exports map) with a local alias such astype Context = typeof github.context, andWebhookPayloadwithtypeof github.context.payload__tests__/testUtils.tsMockContext extends Contextneeds the class viagithub.context.constructor__tests__/bundle/runBundle.tsuses__dirname→import.meta.dirnameaction.yml(node24) runsdist/index.jsas ESM given the rootpackage.jsontypewebpackMissingModuleDependabot will keep proposing the v3/v9 bumps; close them referencing this issue until it is done.