-
Notifications
You must be signed in to change notification settings - Fork 15.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug with the router class #6034
Comments
Whats require-triage label? |
@evokerking1 The Triage Process indicates that it means further triaging is needed to properly classify the issue. |
You wrote const router = app.Router() |
That is all my code. |
Hey @evokerking1 👋 Like @nwalters512 pointed out, could you please confirm if the issue persists even after changing, const route = app.Router to, const router = app.Router() |
This is my code
``// import the route
import { playground } from "@colyseus/playground"
// ...
const monitor = require("@colyseus/monitor").monitor
const express = require("express")
const app = express
const route = app.Router
// ...
route.use("/monitor", monitor)
// bind it as an express middleware
route.use("/playground", playground)
app.listen(3000)
which throws this error
$ bun run index.js
478 | end: false
479 | }, fn);
480 |
481 | layer.route = undefined;
482 |
483 | this.stack.push(layer);
^
TypeError: undefined is not an object (evaluating 'this.stack.push')
at use (/workspace/colyseus-testing-ground/node_modules/express/lib/router/index.js:483:10)
at /workspace/colyseus-testing-ground/index.js:10:7
Bun v1.1.30 (Linux x64)
error: script "test" exited with code 1
and the code that throws this error in the /lib/router/index.js line 483 or this.layer.push()
The text was updated successfully, but these errors were encountered: