Skip to content

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:' #8819

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

Closed
3 of 4 tasks
rjcodedev opened this issue Nov 19, 2023 · 2 comments
Labels
state:duplicate Duplicate of already reported issue type:question Support or code-level question

Comments

@rjcodedev
Copy link

rjcodedev commented Nov 19, 2023

Issue Description

Cloud parameter from new ParseServer instance not working in windows properly, throws error mention in logs

and none of the below line if code works

  1. './cloud/main.js'
  2. file:///C:/myprojects/parse-server-example/cloud/main.js
  3. C:/myprojects/parse-server-example/cloud/main.js
  4. const __dirname = path.resolve() __dirname +'/cloud/main.js'

if I comment cloud parameter server went online without cloud function

Steps to reproduce

create parse server setup in esm and pass this config
export const config = { databaseURI: 'mongodb://0.0.0.0:27017/dev', cloud: "./cloud/main.js", appId: 'myAppId', masterKey: 'masterkey', serverURL: 'http://localhost:1337/parse', }

Server

  • Parse Server version: 6.3.1
  • Operating system: windows 11
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): MonoDB
  • Database version: 7.0
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): javascript
  • SDK version: 4.1.0

Logs

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 new NodeError (node:internal/errors:406:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:216:11)
at defaultLoad (node:internal/modules/esm/load:118:3)
at ModuleLoader.load (node:internal/modules/esm/loader:396:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56)
at new ModuleJob (node:internal/modules/esm/module_job:65:26)
at #createModuleJob (node:internal/modules/esm/loader:290:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:248:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:229:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
node:internal/process/esm_loader:40
internalBinding('errors').triggerUncaughtException(
^

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 new NodeError (node:internal/errors:406:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:216:11)
at defaultLoad (node:internal/modules/esm/load:118:3)
at ModuleLoader.load (node:internal/modules/esm/loader:396:13)
at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:56)
at new ModuleJob (node:internal/modules/esm/module_job:65:26)
at #createModuleJob (node:internal/modules/esm/loader:290:17)
at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:248:34)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:229:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}

Screenshot 2023-11-16 093734
Copy link

Thanks for opening this issue!

@mtrezza
Copy link
Member

mtrezza commented Nov 19, 2023

Closing as duplicate of #8815

@rjcodedev Please read the comment I've left you on the other issue you already opened.

@mtrezza mtrezza closed this as completed Nov 19, 2023
@mtrezza mtrezza added type:question Support or code-level question state:duplicate Duplicate of already reported issue labels Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:duplicate Duplicate of already reported issue type:question Support or code-level question
Projects
None yet
Development

No branches or pull requests

2 participants