Skip to content

[ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. #123

Description

@canserkanuren

Hello,

I have been facing this issue for a few days and I have no way of resolving it...
My current setup is Windows (the following command works fine on Linux)
When running my action with npx local-action . src/main.ts .env, it ends up with the following error:

================================================================================
                                 Running Action
================================================================================

node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:239:11)
    at defaultLoad (node:internal/modules/esm/load:130:3)
    at nextLoad (node:internal/modules/esm/hooks:750:28)
    at load (file:///C:/Users/canse/gitstorage/github-repo-creator/node_modules/tsx/dist/esm/index.mjs?1732564389385:2:1768)
    at nextLoad (node:internal/modules/esm/hooks:750:28)
    at load (file:///C:/Users/canse/gitstorage/github-repo-creator/node_modules/quibble/lib/quibble.mjs:139:13)
    at nextLoad (node:internal/modules/esm/hooks:750:28)
    at Hooks.load (node:internal/modules/esm/hooks:383:26)
    at handleMessage (node:internal/modules/esm/worker:199:24)
    at Immediate.checkForMessages (node:internal/modules/esm/worker:141:28) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

Node.js v21.7.3

I created the action from the official typescript-action repository and only added a few lines of code in order to perform some tests for creating a new action.

The error is reproductible from this repository.
Simply clone it, run npm install and then run the local action with: npx local-action . src/main.ts .env.local
Thanks a lot in advance.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions