Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

I've already installed micro-cors, and when I attempted to build, I got the following result

I encountered the following issue while constructing the Next.js Stripe project and I apologize.

./src/pages/api/webhooks.ts:3:18
Type error: Could not find a declaration file for module 'micro-cors'. 'E:/Project/longlifecoin/node_modules/micro-cors/lib/index.js' implicitly has an 'any' type.

  1 | import Stripe from 'stripe';
  2 | import { buffer } from 'micro';
> 3 | import Cors from 'micro-cors';

I don’t know what is causing this error.
Would be grateful if you could help me out.

I’m crossing my fingers that I can build this project without any issues.
Please help me.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

npm i -D @types/micro-cors.

It’s a TS error that’s common for many packages. TS can’t find the types that it needs to do its job.

Depending on your settings in your editor, you should be able to get realtime feedback on those types of things along with appropriate suggestions too.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading