Skip to content

Fix ES module imports for @actions packages#365

Merged
dawidd6 merged 2 commits into
masterfrom
copilot/fix-import-error-core-module
Jan 30, 2026
Merged

Fix ES module imports for @actions packages#365
dawidd6 merged 2 commits into
masterfrom
copilot/fix-import-error-core-module

Conversation

Copilot AI commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

The action fails at runtime with SyntaxError: The requested module '@actions/core' does not provide an export named 'default'. The @actions packages are CommonJS modules without default exports, incompatible with default import syntax in ES modules.

Changes

  • Convert default imports to namespace imports for @actions packages:
    // Before
    import core from '@actions/core'
    import exec from '@actions/exec'
    import github from '@actions/github'
    import artifact from '@actions/artifact'
    
    // After
    import * as core from '@actions/core'
    import * as exec from '@actions/exec'
    import * as github from '@actions/github'
    import * as artifact from '@actions/artifact'

All usage of these modules remains unchanged as namespace imports expose the same API surface.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
@dawidd6 dawidd6 marked this pull request as ready for review January 30, 2026 14:17
Copilot AI changed the title [WIP] Fix import error for @actions/core module Fix ES module imports for @actions packages Jan 30, 2026
Copilot AI requested a review from dawidd6 January 30, 2026 14:18
@dawidd6 dawidd6 merged commit d66e773 into master Jan 30, 2026
23 checks passed
@dawidd6 dawidd6 deleted the copilot/fix-import-error-core-module branch January 30, 2026 14:23
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.

2 participants