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
Unable to use express-validator with TypeScript 2.3.4 #350
Comments
I had the same problem and tried importing like so: import expressValidator = require('express-validator') Not the prettiest syntax but it works on my side. |
@baptistelambert Thanks. :) Guess I'll have to go the same route too. ;-/ |
REF #350 Fix for TypeScript Typings Revisted
Importing each individual method from 'express-validator/check' works for me:
You then have access to each method within the file. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Based on how the typings are written (the ones that ship with express-validator). I am unable to import the library without compile-time errors.
I've tried:
import * as expressValidator from 'express-validator';
import {ExpressValidator} from 'express-validator';
Both of which result in:
Module '"express-validator"' resolves to a non-module entity and cannot be imported using this construct.'
Is anybody else running into this issue? I figure a workaround would be to delete index.d.ts from node_modules/express-validator/ but I feel concerned about this issue coming up again when the next release of express-validator is published...
Thanks in advance!
The text was updated successfully, but these errors were encountered: