From 0bc4cef99e073cf57f05c3dfd87e44d27aa2c8f5 Mon Sep 17 00:00:00 2001 From: Joshua Garde Date: Sun, 6 Aug 2023 18:39:48 -0700 Subject: [PATCH] Fix preloading path resolution --- lib/utilities.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/utilities.js b/lib/utilities.js index 609b6d5..3bf2d1b 100644 --- a/lib/utilities.js +++ b/lib/utilities.js @@ -48,7 +48,11 @@ export default class Utilities { * cross-reference use of schemas via ajv's resolution */ async #preloadSchemas() { - const schemaDir = await fs.opendir('../schemas'); + const schemaPath = path.resolve( + import.meta.url.replace(/^file:/, ''), + '../../schemas', + ); + const schemaDir = await fs.opendir(schemaPath); for await (const entry of schemaDir) { if (!entry.isFile()) { continue;