Open jakubklimek opened 3 years ago
Yes it will lock up the browser and Node.js. Node.js eventually runs out of memory and aborts. It's likely something recursive due to the way @import
and @context
are used. I started to try and reduce to a small test case since dealing with the current 8 files is a bit much.
I'm guessing this is similar to an older issue but the fix didn't catch this edge case. Or perhaps it's a regression. https://github.com/digitalbazaar/jsonld.js/issues/358 https://github.com/digitalbazaar/jsonld.js/pull/381
I'm not sure what the best fix is until this is dealt with. I'm also not sure if the fix in this case will result in the data working or if it's an error.
@gkellogg I tried this on your distiller but it fails with "URI must be ascii only". Perhaps the test suite needs some tests to check URI encodings work the same across implementations? jsonld.js 4.x Node.js loader uses the old request
library and fails with ERR_UNESCAPED_CHARACTERS
. v5 will be using fetch
API at a low level and it handles these URIs fine. Seems the browser XHR loader handles them too. That being said, at some point I'll have a simplified test case for this recursion issue that should work everywhere.
When I put this file in JSON-LD Playground (running json-ld.js), it freezes and crashes:
In the network tab of chrome, there is a request pending, nevertheless, the requested resource is accessible, so that is not the issue:![image](https://user-images.githubusercontent.com/718827/111430144-41ded280-86fa-11eb-9233-8df55a8dca4c.png)