I have some json schemas in a folder ..src/schema/jsonschemas And I have my node js scripts in a folder ../src/nodescripts/script.js
let Ajv = require('ajv');
let ajv = new Ajv();
jschema = JSON.parse(fs.readFileSync("../src/schema/file.json", 'utf8'));
let validate = ajv.compile(jschema);
But i get the following error: UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2). The cause is the $ref on the json schema(but i ndeed the $ref part. Any Ideas?