breejs / bree

Bree is a Node.js and JavaScript job task scheduler with worker threads, cron, Date, and human syntax. Built for @ladjs, @forwardemail, @spamscanner, @cabinjs.
https://jobscheduler.net
MIT License
2.96k stars 80 forks source link

[fix] Error [ERR_UNSUPPORTED_ESM_URL_SCHEME] #206

Closed spyshow closed 1 year ago

spyshow commented 1 year ago

Describe the bug

i am using this code to add new

await bree.add([
    {
      name: "api",
      path: path.resolve("./jobs/api.js"),
      interval: "5s",
      worker: {
        workerData: {
          name: "api1",
        },
      },
    },
  ]);

but when i run it , it gave me the following error : Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'f:'

any solution ? Node.js version: 18.4

OS version: windows 10

Checklist

shadowgate15 commented 1 year ago

Try updating your version of node.

titanism commented 1 year ago

Please use search engines and Stack overflow before posting errors you receive to GitHub issues.

https://stackoverflow.com/a/70240444

titanism commented 1 year ago

v9.1.3 released to npm, please try again with this version

https://github.com/breejs/bree/releases/tag/v9.1.3