-
Notifications
You must be signed in to change notification settings - Fork 197
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
Resolving remote context: "Dereferencing a URL" error [Regression >= 5.0.0] #451
Comments
Hi, I faced the same issue and dug into the code to find that the following error is thrown:
I noticed that httpClient is a node proxy and for some reason the proxy does not work with jest >= 25. Jest 24.9.0 is fine. |
There is probably a compatibility issue somewhere with esm library |
@Nebulis @dmitrizagidulin thanks for looking into this! |
Hi, Would you consider moving back and not use an ESM only library? So far this change broke almost everywhere in our codebase:
I know that many people in the community (me included) are excited about ESM. I even tried to update our libraries and support ESM only. But turns out it was a mistake and the community is not ready for that.
I wrote about every issue I encountered with ESM in our libraries => Open-Attestation/open-attestation#197 The community is simply not ready for ESM only libraries. Right now, I consider forking your library and get rid of the issue. But to be fair if I can avoid the burden of maintaining a fork, I would be more than happy. |
I'm running into the same error, but in my case this is definitely caused because of redirects and not an issue related to ESM or packaging. I'm posting this here first, just in case, but if the OP is indeed caused by packaging, this is a separate issue. Having said that, I'm running into the error when the node documentLoader encounters a redirect. This is because Edit: |
Downgraded jest to prevent issues with digitalbazaar's jsonld.js. It was throwing "httpClient.get is not a function error". Jest must be kept below 24.9.0 as per this digitalbazaar/jsonld.js#451 (comment) Reverted changes to Jest config by bringing back the `testEnvironment` field. Otherwise WASM code from crypto throws errors. Added TextEncoder and TextDecoder to jest config globals Signed-off-by: lovesh <[email protected]>
Is there any update for this issue? Any workarounds or fixes? Steps to reproduce in our case:
|
I didn't notice that |
One problem seems to be in
I didn't read https://jestjs.io/docs/ecmascript-modules beyond the suggestion to try a node option, and with that the original test code above worked fine (adjust to your local testing setup):
|
Seems the error chain is too deep and just prints out some deep details as console.error(require('util').inspect(error, {depth: 100})); |
This can be reproduced by altering the _app.get('/data/:id', _store, (req, res) => {
res.status(304).json(_data[req.params.id].content);
}); To me the issue is with the handling of http status codes in This 'bug' (feature?) leads to an issue with loading the json-ld context of the ed25519-signature-2020 because this returns a 304 as well 😏 |
@marcvanandel I think your comment may be mixing issues? The other chat here is more related to ESM usage. You might want to create a new issue just for redirection issues. It does look like the default node document loader could use some improvements to better handle different result codes. I'm not sure how 304 would ever be returned since the loader is not sending cache related headers. |
I think my comment above might have been lost in the noise here, but there is definitely an issue with the document loader that is not related to ESM usage. As is, redirects will simply not work. |
I've created #499 for the handling of 304s better |
Hi there, Any updates on this? Were you able to find a working setup with jest and jsonld? We started having this issue (jest and ESM) when switching from jsonld 5.2.0 to 8.1.0. We had another issue with jest when using node v18.14.2 (because of the jsonld 5.2.0 dependency node-fetch 3.0.0-beta.9). I remember that I faced an issue with jsonld before but I am not sure if this could be related. Any updates or explanations are highly appreciated. Thanks a lot! |
After upgrading to jsonld >= 5.0.0 (away from using
request
library anywhere) I've got the following error:for the following
jest
test:This test passes in
jsonld
versions3.x
and4.x
*
The comment in https://github.com/digitalbazaar/jsonld.js/blob/master/lib/documentLoaders/node.js#L180 suggests that it now considers redirects as errors. If that's the case it limits the usability of theIt seems this is just a comment onjsonld.documentLoaders.node()
ky
not the loader itself as the rest of the code suggest it should deal with redirects.*
with some caveats related to the multiple use ofrequest
injest
: immers-space/activitypub-express/issues/40 which was the main motivator for upgradeThe text was updated successfully, but these errors were encountered: