-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using ajv-formats with deno fails #85
Comments
You can try import addFormats from "https://esm.sh/[email protected]"; |
Got the same issue with v3.0.1 with vite/node using typescript 5.4.5, the type definition resolves to this which has no call signature: export interface FormatsPlugin extends Plugin<FormatsPluginOptions> {
get: (format: FormatName, mode?: FormatMode) => Format;
} |
Any resolution on this? |
Needs to fix the export ajv like ajv-validator/ajv#2381 ajv-validator/ajv-keywords#388 etc
|
Although this is a tentative response, it can be avoided by either (deno 1.46.3) import { Ajv, type Plugin } from "npm:[email protected]";
import ajvFormats, { type FormatsPluginOptions } from "npm:[email protected]";
const addFormats = ajvFormats as unknown as Plugin<FormatsPluginOptions>; // The version of ajv must match the dependency on [email protected].
import Ajv from "https://esm.sh/[email protected]";
import addFormats from "https://esm.sh/[email protected]"; |
Using
ajv-formats
with TypeScript+deno (version 1.37.1) fails. I use the 'usual' idiom:and the compiler complains saying "This expression is not callable, [...]import [...] has no call signatures".
The same construction works with
node.js+tsc
.I also looked at the
index.d.ts
file, as cached on my machine by deno, and it does not include any reference toaddFormat
at all, although theindex.js
file has it, but is not part of the exportedformatsPlugin
object.Is this a deno bug or a bug with the distribution of
ajv-formats
?The text was updated successfully, but these errors were encountered: