Skip to content
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

import Schema in javascript gives syntax error "SyntaxError: Named export 'Schema' not found" #50

Open
chrisjameslennon opened this issue Mar 13, 2024 · 1 comment

Comments

@chrisjameslennon
Copy link

import { Schema, validate } from "jtd";

in javascript (i.e. not typescript) gives runtime error
SyntaxError: Named export 'Schema' not found. The requested module 'jtd' is a CommonJS module, which may not support all module.exports as named exports.

@dragonofdeath
Copy link

I guess 'Schema' is just typescript type so it doesn't have any representation on js side
https://github.com/jsontypedef/json-typedef-js/blob/master/src/schema.ts#L18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants