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

Cannot find module 'next-stripe' #30

Closed
caioOlivera opened this issue Jan 29, 2022 · 4 comments
Closed

Cannot find module 'next-stripe' #30

caioOlivera opened this issue Jan 29, 2022 · 4 comments

Comments

@caioOlivera
Copy link

I don't know if this is a bug or if I'm doing something wrong (it could it could possibly be since Im learning React/Next) but Next does not seem to find the library. Im running the command line "yarn add next-stripe@beta", the next-stripe folder is being added in the modules folder and the lock file is being updated with the new dependency and when I try to import { createCheckoutSession } from "next-stripe/client" I get the "Could not find a declaration file for module" error. Could use some help.

@birdboy307
Copy link

I'm getting the same error but this repo doesn't seem to be too active hopefully it does sometime soon for some help

@ynnoj
Copy link
Owner

ynnoj commented Jun 13, 2022

If you're using the library in a Typescript project, it'll error as there's no type definitions (yet).

To remedy this you can just declare the module locally in your own project:

// next-stripe.d.ts
declare module 'next-stripe';

I'm working on adding some typings for the library

@ynnoj ynnoj closed this as completed Jun 13, 2022
@birdboy307
Copy link

With my issue was using JavaScript any suggestions

@ynnoj
Copy link
Owner

ynnoj commented Jun 16, 2022

@birdboy307 I'm not able to replicate this issue in a JavaScript project. Can you provide a reproduction?

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

3 participants