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

@inrupt/solid-client Unknown Scheme Error When Storing Files #22

Open
keylanjensen opened this issue Mar 6, 2024 · 3 comments
Open

Comments

@keylanjensen
Copy link
Collaborator

keylanjensen commented Mar 6, 2024

When a typescript file calls @inrupt/solid-client's functions for storing a file in a Pod server (overwriteFile() or saveFileInContainer()), the fetch fails with this error provided to engine output:

TypeError: fetch failed
    at node:internal/deps/undici/undici:12344:11
    at async overwriteFile (C:\Users\Keylan\Documents\CS480\practice_module\test_pico\updated_dependencies\pico-engine\node_modules\@inrupt\solid-client\dist\index.js:1912:22)
    at async Object.<anonymous> (C:\Users\Keylan\Documents\CS480\practice_module\test_pico\updated_dependencies\pico-engine\packages\pico-engine-core\dist\modules\pods.js:65:23)
    at async Object.body (C:\Users\Keylan\.pico-engine\rulesets\1.3.0\91\a3\91a3bc8ae015b6fe94bf6bdcadea9cf6b1f30ed7963e9e5446e8ae506208cb05.js:71:11) {
  cause: Error: unknown scheme
      at makeNetworkError (node:internal/deps/undici/undici:5585:35)
      at schemeFetch (node:internal/deps/undici/undici:10472:34)
      at node:internal/deps/undici/undici:10342:26
      at mainFetch (node:internal/deps/undici/undici:10361:11)
      at fetching (node:internal/deps/undici/undici:10309:7)
      at fetch (node:internal/deps/undici/undici:10173:20)
      at Object.fetch (node:internal/deps/undici/undici:12343:10)
      at fetch (node:internal/process/pre_execution:335:27)
      at writeFile (C:\Users\Keylan\Documents\CS480\practice_module\test_pico\updated_dependencies\pico-engine\node_modules\@inrupt\solid-client\dist\index.js:1990:73)
      at overwriteFile (C:\Users\Keylan\Documents\CS480\practice_module\test_pico\updated_dependencies\pico-engine\node_modules\@inrupt\solid-client\dist\index.js:1912:28)
}

This output is given in both the main and dependency-updates branches.

@keylanjensen
Copy link
Collaborator Author

This is taken from running npm ls buffer in the dependency-updates branch of the Pico engine.

$ npm ls buffer
pico-engine@ C:\Users\Keylan\Documents\CS480\practice_module\test_pico\updated_dependencies\pico-engine
├─┬ @inrupt/[email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├─┬ @bergos/[email protected]
│   │ └── [email protected] deduped
│   ├── [email protected] deduped
│   └─┬ [email protected]
│     └── [email protected] deduped
├─┬ [email protected] extraneous
│ └── [email protected] deduped
└─┬ [email protected] extraneous
  └── [email protected] deduped

In the main branch, npm ls buffer returns:

$ npm ls buffer
pico-engine@ C:\Users\Keylan\Documents\CS480\practice_module\test_pico\pico-engine
├─┬ @inrupt/[email protected]
│ ├── [email protected]
│ └─┬ [email protected]
│   ├─┬ @bergos/[email protected]
│   │ └── [email protected] deduped
│   ├── [email protected] deduped
│   └─┬ [email protected]
│     └── [email protected] deduped
├─┬ [email protected] extraneous
│ └── [email protected] extraneous
├─┬ [email protected] extraneous
│ ├─┬ [email protected] extraneous
│ │ └── [email protected] deduped
│ └── [email protected] extraneous
├─┬ [email protected] extraneous
│ └── [email protected] extraneous
├─┬ [email protected] extraneous
│ ├─┬ [email protected] extraneous
│ │ └── [email protected] deduped
│ └── [email protected] extraneous
├─┬ [email protected] extraneous
│ ├─┬ [email protected] extraneous
│ │ └── [email protected] deduped
│ └── [email protected] extraneous
└─┬ [email protected] extraneous
  └── [email protected] extraneous

When running npm run clean-setup in the main branch, it returns:

lerna info lifecycle [email protected]~prepublish: [email protected]

> [email protected] prepublish C:\Users\Keylan\Documents\CS480\practice_module\test_pico\pico-engine\packages\pico-engine-core
> npm run build

../../node_modules/@inrupt/solid-client/dist/resource/file.d.ts(2,15): error TS2305: Module '"buffer"' has no exported member 'File'.
lerna info lifecycle [email protected]~prepublish: Failed to exec prepublish script
lerna ERR! lifecycle "prepublish" errored in "pico-engine-core", exiting 2

This issue is not seen when running npm run clean-setup in the dependency-updates branch.

@farskipper
Copy link
Member

The dependency-updates updates a lot of things to be compatible with the latest node LTS, so I'd recommend developing on that instead of what's currently in main.

@b1conrad If you're ready, I'd recommend merging dependency-updates and releasing a 1.4.0. If there are any compatibility issues with existing deployments, they can adjust or lock to 1.3.x

@farskipper
Copy link
Member

For the fetch failed unknown scheme issue, that's probably coming from how the solid-client is configured. At some point that library calls fetch(url, ...) and the url string does not start with a proper scheme i.e. https://, file:// etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants