Ianodad / TakeNotes

Take notes with this Note application built on NextJs.
https://take-notes-nine.vercel.app/
9 stars 2 forks source link

Help! #1

Open heinwaiyanhtet opened 1 year ago

heinwaiyanhtet commented 1 year ago
import nc from "next-connect";
import onError from "../../../middlewares/errors";
import { getStreaming, postStreaming } from "../../../controller/StreamingController";

// Initiate next-connect with error middleware
const handler  = nc ({ onError });

// Define routes using the handler's methods
handler.get(getStreaming);

handler.post(postStreaming);

export default handler; 

How can I solve it?- - error pages/api/Streaming/streaming.tsx (6:21) @ eval

error Error [TypeError]: next_connectWEBPACK_IMPORTED_MODULE0default(...) is not a function

Ianodad commented 1 year ago

check nextjs version. only works with nextJs > 12. Next js version 12 and below.

On Mon, 14 Aug 2023 at 19:03, Hein Wai Yan Htet @.***> wrote:

import nc from "next-connect"; import onError from "../../../middlewares/errors"; import { getStreaming, postStreaming } from "../../../controller/StreamingController";

// Initiate next-connect with error middleware const handler = nc ({ onError });

// Define routes using the handler's methods handler.get(getStreaming); handler.post(postStreaming);

export default handler;

How can I solve it?- - error pages/api/Streaming/streaming.tsx (6:21) @ eval

error Error [TypeError]: next_connectWEBPACK_IMPORTED_MODULE0default(...) is not a function

— Reply to this email directly, view it on GitHub https://github.com/Ianodad/TakeNotes/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI4YLOHEYG2SRCR5UDSFWXTXVJD37ANCNFSM6AAAAAA3P4WDUY . You are receiving this because you are subscribed to this thread.Message ID: @.***>