Error with router
See original GitHub issue router.get('/test', jwt({
secret: 'test'
}), (req, res ) => {
if(!req.user.admin) return res.status(401);
res.status(200);
})
is my route, when i try to access the route i get this error:
Error
at middleware (C:\Users\jerom\Git\web\node_modules\express-jwt\lib\index.js:75:21)
at Layer.handle [as handle_request] (C:\Users\jerom\Git\web\node_modules\express\lib\router\layer.js:95:5)
at next (C:\Users\jerom\Git\web\node_modules\express\lib\router\route.js:131:13)
at Route.dispatch (C:\Users\jerom\Git\web\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (C:\Users\jerom\Git\web\node_modules\express\lib\router\layer.js:95:5)
at C:\Users\jerom\Git\web\node_modules\express\lib\router\index.js:277:22
at Function.process_params (C:\Users\jerom\Git\web\node_modules\express\lib\router\index.js:330:12)
at next (C:\Users\jerom\Git\web\node_modules\express\lib\router\index.js:271:10)
at router.use (C:\Users\jerom\Git\web\routes\api.js:19:3)
at Layer.handle [as handle_request] (C:\Users\jerom\Git\web\node_modules\express\lib\router\layer.js:95:5)
can’t figure out why i’m getting this error. Is this a known issue with the express router?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
The most common Wi-Fi problems and how to fix them
Resetting your router can fix myriad issues, and an inability to connect is one of them. Press the Reset button on the back...
Read more >No Internet Connection? How to Troubleshoot Internet Issues
Restarting your modem and router should be the first thing you do when encountering an internet signal issue. Don't skip this step!
Read more >errorElement v6.6.1 - React Router
When a route does not have an errorElement , errors will bubble up through parent routes. This lets you get as granular or...
Read more >How to troubleshoot five common routing errors - TechTarget
Troubleshooting router errors is made easier with this tip, which covers the five major routing errors -- filtering redistribution, mismatched ...
Read more >Troubleshooting Router Error Responses | Cloud Foundry Docs
Troubleshooting Router Error Responses ; Log Formatting. Levels; Message Contents ; Diagnose Gorouter Errors. Gorouter Cannot Connect to the App ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into the issue and digging in…it looks like this is as designed. The best workaround I see is to add this to the bottom of your express app before opening the port
this should provide a clearer error message
@jerome724 could you please share what was your problem? I’m having the same issue.