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

@curveball/validator is a devDependency but imported at runtime #185

Open
arild-haugstad opened this issue Aug 21, 2024 · 1 comment
Open

Comments

@arild-haugstad
Copy link

html-index.tsx has a line

import '@curveball/validator';
but @curveball/validator is a devDependency.

This was introduced in 5981787, and the purpose appears to be to to modify the type of Context to have member schemas via the declaration in https://github.com/curveball/validator/blob/3259fb6ac3a7decce51307668efea9462fc3247f/src/declarations.ts

Unfortunately, this import statement becomes part of the output in dist/html-index.js -- which has no obvious effect if @curveball/validator is installed, but leads to error ERR_MODULE_NOT_FOUND if it is not installed.

I believe that the "right" way of expressing import purely for side-effects on types would be

/// <reference types="@curveball/validator" />

at the start of html-index.tsx instead of the import statement; this loads the appropriate type information for type check, but without an import of @curveball/validator in the output; at least it does on my computer...

@evert
Copy link
Member

evert commented Aug 21, 2024

Worth fixing!

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