You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The module js-schema should be imported in typescript using
import * as schema from 'js-schema';
rather than
import schema from 'js-schema';
I tried it on my current project and it raise an on error from typescript in my editor but pass the compilation and the generated javascript file works perfectly.
This typescript error seems to be an issue with the @types/js-schema types definitions module,
I changed it's index.d.ts file and it now works fine.
the index.d.ts now looks like that:
Following TypeScript code
is transpiled into followin JS code
which leads to the error
TypeError: js_schema_1.default is not a function
How do I prevent transpiling this default-property?
I found a similar issue here: microsoft/TypeScript#5565
The text was updated successfully, but these errors were encountered: