You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I think this is related to the bootstrap process that resolves the file paths before invoking the local-action logic. Let me break out my Windows box and test this out a bit further...
Looks like it is because the action repo you linked is ESM. There's some additional steps involved to get ESM to work with local-action and GitHub Actions in general.
In the immediate term, I was able to get past the error by removing "type": "module" from package.json.
Longer term, I've submitted a PR to convert the TypeScript template to ESM. I also have an example of a working TypeScript action here you can reference here: https://github.com/issue-ops/parser
When removing "type": "module" from the package.json, I have the following error:
I added "type": "module" in order to remove the error above..
I'll wait for your PR to be merged, in order to see if it solves my issue.
Thanks a lot for your help.
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: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.
The text was updated successfully, but these errors were encountered: