Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

enter image description here

enter image description here

like image 382
Lillian Carr Avatar asked Dec 07 '25 06:12

Lillian Carr


1 Answers

Please install yarn add @types/micro-cors or npm i @types/micro-cors

As a last resort, You can add // @ts-ignore to the line above to ignore any type-checking issues.

like image 123
tzztson Avatar answered Dec 09 '25 20:12

tzztson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!