dwn-sdk-js
dwn-sdk-js copied to clipboard
Intermittently hit with validator errors
This appears randomly from Vite, with no error thrown in the actual console on the app side:
This is what is reported from console:
[vite] Internal server error: Failed to resolve import "../generated/precompiled-validators.js" from "node_modules\@tbd54566975\dwn-sdk-js\src\schema-validator.ts". Does the file exist?
Plugin: vite:import-analysis
File: C:/repos/dai1y/node_modules/@tbd54566975/dwn-sdk-js/src/schema-validator.ts
1 | import * as precompiledValidators from "../generated/precompiled-validators.js";
| ^
2 | export function validateJsonSchema(schemaName, payload) {
3 | const validateFn = precompiledValidators[schemaName];
at formatError (C:\repos\dai1y\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:39080:46)
at TransformContext.error (C:\repos\dai1y\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:39076:19)
at normalizeUrl (C:\repos\dai1y\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:58360:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TransformContext.transform (C:\repos\dai1y\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:58509:57)
at async Object.transform (C:\repos\dai1y\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:39317:30)
at async doTransform (C:\repos\dai1y\node_modules\vite\dist\node\chunks\dep-6e2fe41e.js:50043:29)
Are you using released package? Or are you working in the dwn-sdk-js
itself? If the former, then I don't know why vite
would randomly not find the file, the file is there, unless it is failing to copy it before starting the server.