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

Can't be used within remix routes #2337

Closed
arman94 opened this issue Nov 8, 2023 · 7 comments
Closed

Can't be used within remix routes #2337

arman94 opened this issue Nov 8, 2023 · 7 comments
Labels

Comments

@arman94
Copy link

arman94 commented Nov 8, 2023

No description provided.

@bhavik001
Copy link

Hey @arman94 Can you describe this issue?

@hilja
Copy link

hilja commented Nov 12, 2023

Screenshot 2023-11-12 at 18 53 17

Not sure what OP means but I have issues with Remix. Just a regular import:

import isEmail from 'validator/lib/isEmail'
import isEmail from 'validator/es/lib/isEmail'

Results in:

Cannot find module 'validator/lib/isEmail' or its corresponding type declarations.

But the files clearly are there, I can cmd+click it and see the export.

In my tsconfig.json I've got:

{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "target": "ES2022",
  }
}

I can import with the file extension: import isEmail from 'validator/es/lib/isEmail.js', but then when I use it TS whines about it:

This expression is not callable.
  Type 'typeof import("/Users/bob/foo/node_modules/.pnpm/@types+validator@13.11.6/node_modules/@types/validator/es/lib/isEmail")' has no call signatures.

@hilja
Copy link

hilja commented Nov 12, 2023

Screenshot 2023-11-12 at 19 10 12

Seems like you're trying to export toString which doesn't exist. Don’t know if it's related.

@arman94
Copy link
Author

arman94 commented Nov 13, 2023

This is the exact issue I have with validator in Remix

@WikiRik
Copy link
Member

WikiRik commented Nov 13, 2023

Type declarations are not handled in this project, but in the DefinitelyTyped repository; https://github.com/DefinitelyTyped/DefinitelyTyped

@aszmyd
Copy link

aszmyd commented Feb 29, 2024

Having the same issue here. I have @types/validator added but it's not helping.

@WikiRik
Copy link
Member

WikiRik commented May 7, 2024

I'm closing this issue since this is not something we can fix in this repo. Issues with @types/validator can be reported in the DefinitelyTyped repository; DefinitelyTyped/DefinitelyTyped

@WikiRik WikiRik closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants