eggsy / discord-steam-verification

🧬 Check if a user owns the specific item(s) in their Steam library and give them roles! Discord bot and API.
MIT License
49 stars 9 forks source link

[BUG] Failed to start on windows server 2016 | Node JS v18.14.0 #21

Closed gdavey closed 1 year ago

gdavey commented 1 year ago

I have read all of the README file and checked if this was reported before

Describe the bug Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data are supported by the default ESM loade r. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' ←[90m at new NodeError (node:internal/errors:399:5)←[39m ←[90m at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1059:11)←[39m ←[90m at defaultResolve (node:internal/modules/esm/resolve:1135:3)←[39m ←[90m at nextResolve (node:internal/modules/esm/loader:163:28)←[39m ←[90m at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)←[39m ←[90m at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)←[39m ←[90m at ESMLoader.import (node:internal/modules/esm/loader:525:22)←[39m ←[90m at importModuleDynamically (node:internal/modules/cjs/loader:1159:29)←[39m ←[90m at importModuleDynamicallyWrapper (node:internal/vm/module:429:21)←[39m ←[90m at importModuleDynamically (node:internal/vm:102:46)←[39m ←[90m at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)←[39m at ←[90mC:\Users\admin\Desktop\discord-steam-verification\←[39mdist\index.js:345:78 at Array.forEach () at API.loadEndpoints ←[90m(C:\Users\admin\Desktop\discord-steam-verification\←[39mdist\index.js:342:17←[90m)←[39m at new API ←[90m(C:\Users\admin\Desktop\discord-steam-verification\←[39mdist\index.js:330:10←[90m)←[39m at new Main ←[90m(C:\Users\admin\Desktop\discord-steam-verification\←[39mdist\index.js:567:16←[90m)←[39m at Object. ←[90m(C:\Users\admin\Desktop\discord-steam-verification\←[39mdist\index.js:570:1←[90m)←[39m ←[90m at Module._compile (node:internal/modules/cjs/loader:1226:14)←[39m ←[90m at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)←[39m ←[90m at Module.load (node:internal/modules/cjs/loader:1089:32)←[39m ←[90m at Module._load (node:internal/modules/cjs/loader:930:12)←[39m ←[90m at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)←[39m ←[90m at node:internal/main/run_main_module:23:47←[39m { code: ←[32m'ERR_UNSUPPORTED_ESM_URL_SCHEME'←[39m }

Node.js v18.14.0

eggsy commented 1 year ago

Hey @gdavey! 👋

Thank you for the issue, I wouldn't find about this issue if you didn't report it! I just tested it on my Windows VM and pushed one line update to fix the issue. You can sync your fork or manually change the 56th line in src/util/api.ts:

- join(__dirname, `/endpoints/${file}`)
+ join("file://", __dirname, `/endpoints/${file}`)

This should work on Windows, as well as unix systems. Let me know if it doesn't work out!

gdavey commented 1 year ago

This worked thank you