Closed artismarti closed 3 years ago
I'm able to get the right responses in the browser:
when I navigate to the api /api/coffee.js with the following code:
/api/coffee.js
import nextConnect from "next-connect"; export default nextConnect() .get(async (req, res) => { res.statusCode = 200; res.json({ "Hello": "World" }); })
However when I go to the home page I get this error:
The stack trace points to this line of code: const router = new Trouter();
const router = new Trouter();
Any help with this is massively appreciated. Thank you! :)
I think this was because I had imported the api file in my index.js file. Once I removed the import, this error disappeared.
I'm able to get the right responses in the browser:
when I navigate to the api
/api/coffee.js
with the following code:However when I go to the home page I get this error:
The stack trace points to this line of code:
const router = new Trouter();
Any help with this is massively appreciated. Thank you! :)