ynnoj/next-stripe

Cannot find module 'next-stripe'

caioOlivera opened this issue · 4 comments

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.

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 commented

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

With my issue was using JavaScript any suggestions

ynnoj commented

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