Skip to content

fix: import ESM packages without a default export - #657

Merged
DerekRoberts merged 1 commit into
mainfrom
fix/schedule-esm-imports
Oct 8, 2026
Merged

DerekRoberts merged 1 commit into
mainfrom
fix/schedule-esm-imports

Conversation

@DerekRoberts

@DerekRoberts DerekRoberts commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Scheduled ministry and crawler jobs crash on startup because Node 24 rejects default imports of packages that have no default export.

Description

schema/script/index.js imported @actions/core 3.0.1 as a default export, and crawler/src/main.js did the same with js-yaml 5.4.1. Both packages are ESM with named exports only. The scheduled workflow on main exits in Process script with does not provide an export named 'default' (run 37707107595, and the Oct 7 run before it).

Namespace imports keep the existing call sites (core.setOutput, jsYaml.load).

The soft-delete job in that same run failed separately: oc login to api.silver.devops.gov.bc.ca:6443 timed out. That job succeeded on Oct 7, and the crawler job logged in during the failing run. This PR does not change that login.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Node 24 container: import * as core from "@actions/core" and typeof core.setOutput === "function"
  • Node 24 container: import * as jsYaml from "js-yaml" and typeof jsYaml.load === "function"

Checklist

  • I have read the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have already been accepted and merged

Further comments

No new dependencies. The soft-delete cluster timeout is a separate, intermittent dial failure and is left alone.


Thanks for the PR!

Deployments, as required, will be available below:

Please create PRs in draft mode. Mark as ready to enable:

After merge, new images are deployed in:

Node 24 rejects default imports of @actions/core and js-yaml, so the scheduled ministry and crawler jobs exit before they run.
Copilot AI balanced review requested due to automatic review settings October 8, 2026 03:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

Both targeted import corrections match the packages’ named-export APIs without changing runtime behavior.

0 open findings

What changed in this PR

Fixes Node 24 startup failures in scheduled schema and crawler jobs by using valid ESM namespace imports.

Changes:

  • Corrects the @actions/core import.
  • Corrects the js-yaml import while preserving existing call sites.
File Description
schema/​script/​index.js Uses a namespace import for @actions/core.
crawler/​src/​main.js Uses a namespace import for js-yaml.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@DerekRoberts DerekRoberts self-assigned this Oct 8, 2026
@DerekRoberts
DerekRoberts enabled auto-merge (squash) October 8, 2026 03:24

@mishraomp mishraomp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice eye, thanks for fixing it, you are rocking it 🚀

@DerekRoberts
DerekRoberts merged commit caf5354 into main Oct 8, 2026
14 checks passed
@DerekRoberts
DerekRoberts deleted the fix/schedule-esm-imports branch October 8, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants