I'm trying to enable cors for my next.js API.
Based on docs and the example I installed cors:
npm i cors
And I can verify that it's in my package.json:
"cors": "^2.8.5",
And it's in my node_modules directory.
However, when I use import Cors from 'cors' in my api code, I get this error:
Module not found: Can't resolve 'cors'
Why do I get this error while the package is installed? I also tried const cors = require('cors') and got the same error.