Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
canserkanuren opened this issue Nov 25, 2024 · 0 comments

Comments

@canserkanuren
Copy link

canserkanuren commented Nov 25, 2024

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.

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

No branches or pull requests

1 participant