APIDevTools / json-schema-ref-parser

Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
https://apitools.dev/json-schema-ref-parser
MIT License
942 stars 226 forks source link

I'm getting this error while using $RefParser.derefernce in angular ionic #345

Closed shivam-2701 closed 4 months ago

shivam-2701 commented 4 months ago
TypeError: Cannot read properties of undefined (reading 'sep')
    at convertPathToPosix (convert-path-to-posix.js:12:81)
    at Object.resolve (url.js:53:64)
    at $RefParser._callee$ (index.js:101:25)
    at tryCatch (index.js:2:1)
    at Generator.<anonymous> (index.js:2:1)
    at Generator.next (index.js:2:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:25:1)
    at asyncToGenerator.js:32:1
    at new ZoneAwarePromise (zone.js:913:33)
    at $RefParser.<anonymous> (asyncToGenerator.js:21:1)
    at $RefParser.parse (index.js:137:6)
    at $RefParser._callee2$ (index.js:145:24)
    at tryCatch (index.js:2:1)
    at Generator.<anonymous> (index.js:2:1)
    at Generator.next (index.js:2:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:25:1)
    at asyncToGenerator.js:32:1
    at new ZoneAwarePromise (zone.js:913:33)
    at $RefParser.<anonymous> (asyncToGenerator.js:21:1)
    at $RefParser.resolve (index.js:153:6)
    at $RefParser._callee4$ (index.js:181:24)
    at tryCatch (index.js:2:1)
    at Generator.<anonymous> (index.js:2:1)
    at Generator.next (index.js:2:1)
    at asyncGeneratorStep (asyncToGenerator.js:3:1)
    at _next (asyncToGenerator.js:25:1)
    at asyncToGenerator.js:32:1
    at new ZoneAwarePromise (zone.js:913:33)
    at $RefParser.<anonymous> (asyncToGenerator.js:21:1)
    at $RefParser.dereference (index.js:189:6)
    at Function.dereference (index.js:176:37)
    at EntityFieldsMappingUtils.<anonymous> (entity-fields-mapping-utils.ts:29:41)
    at step (main.js:75053:23)
    at Object.next (main.js:75034:53)
    at main.js:75028:71
    at new ZoneAwarePromise (zone.js:913:33)
    at push.qKqo.__awaiter (main.js:75024:12)
    at push.qKqo.EntityFieldsMappingUtils.parseJSONSchema (entity-fields-mapping-utils.ts:26:110)
    at EntityFieldsMappingUtils.<anonymous> (entity-fields-mapping-utils.ts:156:34)
    at step (main.js:75053:23)
    at Object.next (main.js:75034:53)
    at main.js:75028:71
    at new ZoneAwarePromise (zone.js:913:33)
    at push.qKqo.__awaiter (main.js:75024:12)
    at push.qKqo.EntityFieldsMappingUtils.buildFieldMapping (entity-fields-mapping-utils.ts:152:61)
    at ItemImportHelper.<anonymous> (item-import-helper.ts:252:63)
    at step (main.js:8956:23)
    at Object.next (main.js:8937:53)
jonluca commented 4 months ago

I fixed this specific issue, but I'm wondering if you'll need to polyfill path for it to properly work

shivam-2701 commented 4 months ago

Can you please tell me or point out some resources to set polyfill path in my angular ionic project, I am new to this... Any help is much appreciated

jonluca commented 4 months ago

Does the latest version work for you?

shivam-2701 commented 4 months ago

Does the latest version work for you?

It got fixed in the latest version, Thank you very much Sir