-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
An error with npm start: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' #432
Comments
Thanks for opening this issue! |
The same error use Node.js v18.12.1 at windows 10. The node path module path.resolve return path with driver letter,not file:// protocal. The error is occur at import cloud function,modify node_modules\parse-server\lib\ParseServer.js is running now.o(╥﹏╥)o
|
we are also experiencing this error. Is that a solution for windows users? |
Is this a Parse Server issue, rather than a Parse Server example issue? Where is the problematic code? |
Hi, I think it's a Parse Server example issue and the problem is the import of the 'non ES module'-file cloud/main.js because of the error message on start with 'node index.js':
so I renamed cloud/main.js to cloud/main.cjs (and deleted the |
spec : In above code I highlighted cloud code line in which I get this same error only on windows and it run perfectly fine on macos what should I do ? please help @mtrezza |
@prafull-opensignlabs i miss the same error too! |
this error was resolve: |
@ok111net work like charm 👍 |
Can this issue be closed? |
As a mention in documentation of parse server , it's not working in windows that's way instead of that we have to use below code to work windows so you decide @mtrezza |
Do you suggest a change in the source code or an amendment to the docs? |
I tried @prafull-opensignlabs code, however it didn't work for me, but if somehow this code works, adding this config as an option to the parse-server-example will be a good idea, since many of the parse-server users use Windows OS @mtrezza |
I have implement parse server in type : module way instead of common js then it work for me you can try same |
sure I have create main.js file which inlcudes my cloud functions and I have changed this line of code
to start server below code use |
…olute paths protocol
This worked well, thanks @prafull-opensignlabs , but why you've changed |
Because I want parse server on |
my system is windows
node version: Node.js v18.15.0
database: Postgresql
When I run npm start, something went wrong
C:\Users\a\Desktop\Parse-Server>npm start
warn: DeprecationWarning: The Parse Server option 'allowClientClassCreation' default will change to 'false' in a future version.
warn: DeprecationWarning: The Parse Server option 'allowExpiredAuthDataToken' default will change to 'false' in a future version.
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data 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:399:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1059:11)
at defaultResolve (node:internal/modules/esm/resolve:1135:3)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ESMLoader.import (node:internal/modules/esm/loader:525:22)
at importModuleDynamically (node:internal/modules/cjs/loader:1186:29)
at importModuleDynamicallyWrapper (node:internal/vm/module:429:21)
at importModuleDynamically (node:internal/vm:106:46) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
node:internal/process/esm_loader:97
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file and data 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:399:5)
at throwIfUnsupportedURLScheme (node:internal/modules/esm/resolve:1059:11)
at defaultResolve (node:internal/modules/esm/resolve:1135:3)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ESMLoader.import (node:internal/modules/esm/loader:525:22)
at importModuleDynamically (node:internal/modules/cjs/loader:1186:29)
at importModuleDynamicallyWrapper (node:internal/vm/module:429:21)
at importModuleDynamically (node:internal/vm:106:46) {
code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
}
Node.js v18.15.0
The text was updated successfully, but these errors were encountered: