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

$rdf is not defined #225

Closed
jaxoncreed opened this issue Feb 16, 2022 · 11 comments
Closed

$rdf is not defined #225

jaxoncreed opened this issue Feb 16, 2022 · 11 comments

Comments

@jaxoncreed
Copy link

Hey Jeff,

First time using solid-file-client. I had some trouble with the following error: ReferenceError: $rdf is not defined. It seems that something wants rdflib, but it can't get it. Here's my code:

import { SolidNodeClient } from "solid-node-client";
import SolidFileClient from "solid-file-client";

const auth = new SolidNodeClient();
const fileClient = new SolidFileClient(auth);

async function run() {
  const inputPath = "/clone-to-solid-pod/testClone/";
  const targetContainer = "https://solidweb.me/jackson/cloned/";
  const refreshToken = ".....";
  const clientId = ".....";
  const clientSecret = "....";
  const oidcIssuer = "https://solidweb.me/";

  let session = await auth.login({
    clientId,
    clientSecret,
    refreshToken,
    oidcIssuer,
  });

  if(session.isLoggedIn){
    await fileClient.copyFolder(`file://${inputPath}`, targetContainer);
  }
}
run();

[email protected] and [email protected]

@jeff-zucker
Copy link
Owner

Hmm, are you sure you aren't doing anything else other than what you show there? I copied it locally and changed only the target and jwt and got no errors and the stuff cloned correctly. AFAIK the only reason solid-node-client would need $rdflib is the stuff mentioned in the README about patch of local files.

@jaxoncreed
Copy link
Author

Sorry, I didn't include the call stack.

ReferenceError: $rdf is not defined
    at /Users/jackson/O/clone-to-solid-pod/node_modules/@solid-rest/core/dist/cjs/handleResponse.js:128:15
    at new Promise (<anonymous>)
    at serialize (/Users/jackson/O/clone-to-solid-pod/node_modules/@solid-rest/core/dist/cjs/handleResponse.js:127:12)
    at SolidRest.handleResponse (/Users/jackson/O/clone-to-solid-pod/node_modules/@solid-rest/core/dist/cjs/handleResponse.js:142:20)
    at async SolidRest.fetch (/Users/jackson/O/clone-to-solid-pod/node_modules/@solid-rest/core/dist/cjs/index.js:55:12)

The problem seems to be here https://github.com/solid/solid-rest/blob/main/core/src/handleResponse.js#L116. Any ideas?

I don't think I'm doing anything else locally. The project uses typescript, but I don't think that should affect anything.

@jeff-zucker
Copy link
Owner

Oh, darn, yes. I added ability to pass JSON-LD in the accept header and that uses $rdf. It would only get triggered when passed an explicity accept header which is why it failed for you and not me. I'll fix trap it and document it. Thanks!

@jaxoncreed
Copy link
Author

Cool thanks!

@jaxoncreed
Copy link
Author

Hey @jeff-zucker do you know when this will be fixed?

@jeff-zucker
Copy link
Owner

jeff-zucker commented Feb 22, 2022 via email

@jeff-zucker
Copy link
Owner

Version 2.1.1 of solid-node-client should now include version 2.1.8 of @solid-rest/file which should now include version 2.14 of @solid-rest/core which should solve this problem in solid-file-client.

@jaxoncreed
Copy link
Author

Awesome! Thanks

@jaxoncreed
Copy link
Author

Okay, I'll close out this issue, but I've encountered another problem in this issue: solid-contrib/solid-rest#76

@jaxoncreed
Copy link
Author

Hey, sorry for the delay in testing. I'm still experiencing the problem.

To recreate it, go to this repo: https://github.com/o-development/clone-to-solid-pod and follow the instructions labeled "Running the program without the github hook" in the readme.

You should see the message ReferenceError: $rdf is not defined

@jaxoncreed jaxoncreed reopened this Mar 9, 2022
@jeff-zucker
Copy link
Owner

Fixed in o-development/clone-to-solid-pod#1

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