Skip to content

Bug with the router class #6171

Answered by IamLizu
evokerking1 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @evokerking1 👋

The error occurs because app and Router need to be initialized with express() and express.Router() respectively, not just referenced.

const app = express()
const router = app.Router()

I hope it resolves your issue.

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by IamLizu
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants
Converted from issue

This discussion was converted from issue #6034 on November 12, 2024 12:01.