json-schema-ref-parser icon indicating copy to clipboard operation
json-schema-ref-parser copied to clipboard

dereference works different in node and browser environment

Open sathish2017 opened this issue 11 months ago • 1 comments

  1. Resolve and dereference works as expected in node js env. But for browser environment $id is expected to be a url in my case it's custom path which will get resolved by configuring resolvers, for $ref cases even after resolving with custom resolvers, a separate call has been made again with path value in $id. Since value in $id is not a complete http url, it gets failed at that time.

Only way to make it work proper is to make $id as full complete path to json.

  1. Also for base schema passed to dereference method is also loaded in resolver with $id value, since I have passed complete base schema as obj why would it make http call again with $id attr of base schema.

  2. Also in browser env, some times it throws process not found error. When I bundle with webpack again it gets resolved, but same issue occurs later.

sathish2017 avatar Jan 16 '25 12:01 sathish2017

Can you share a reproducible example?

jonluca avatar Jan 28 '25 22:01 jonluca