Next.js Discord

Discord Forum

Next-Connect help!

Answered
American black bear posted this in #help-forum
Open in Discord
American black bearOP
Hi, i'm using next-connect for my project, and i have an error everytime, i will link a picture for it. My code is down below:

import { NextApiRequest, NextApiResponse } from "next";
import type { SteamProfile } from "./passport";

import passport from "./passport";

import nextConnect from "next-connect";
import session from "cookie-session";

export type NextSteamAuthApiRequest = NextApiRequest & {user: SteamProfile}; 

const router = nextConnect<NextApiRequest, NextApiResponse>(); -- basically no nextConnect found :/

router.use(session({
    secret: process.env.SESSION_SECRET,
    maxAge: 1000 * 60 * 60 * 24 * 30 // 30 days
}));


// Passport
router.use(passport.initialize());
router.use(passport.session());

export default router; 


thanks!
Answered by Golden-winged Warbler
Your usage does not look like the examples the project provides: https://github.com/hoangvvo/next-connect
View full answer

4 Replies

Golden-winged Warbler
Your usage does not look like the examples the project provides: https://github.com/hoangvvo/next-connect
Answer
@Golden-winged Warbler Your usage does not look like the examples the project provides: https://github.com/hoangvvo/next-connect
American black bearOP
yeah, cause im writing it from another github repo (older one)
Golden-winged Warbler
Considering the latest release is v1.0.0, I would use that
American black bearOP
tought so :/