Skip to content
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

[cssg-plugin-assets] pathToFileURL() issue on Windows #73

Open
yannikrauter opened this issue Mar 13, 2024 · 0 comments
Open

[cssg-plugin-assets] pathToFileURL() issue on Windows #73

yannikrauter opened this issue Mar 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@yannikrauter
Copy link

When working with contentful-ssg on macOS or Linux, everything works as expected. However, I have come across an error while trying to get my project to run on Windows.

I'm using contentful-ssg to pull my entries from Contentful, as well as the cssg-plugin-assets to also pull any assets. I believe the error I'm receiving is caused by the assets plugin and might have something to do with not using "url.pathToFileURL()", as described here.

After applying npx cssg fetch -v, the output log of my terminal looks like this (only when using Windows):

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 ModuleLoader.load (node:internal/modules/esm/loader:403:13)
    at ModuleLoader.moduleProvider (node:internal/modules/esm/loader:285:56)
    at new ModuleJob (node:internal/modules/esm/module_job:65:26)
    at #createModuleJob (node:internal/modules/esm/loader:297:17)
    at ModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:254:34)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:235:17)
    at async ModuleLoader.import (node:internal/modules/esm/loader:322:23) {
  code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'

I have tried various node versions and fixes to circumvent the issue but unfortunately, to no avail.

Node version:
v20.11.1

Hugo version:
v0.122

@bezoerb bezoerb added the bug Something isn't working label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants