-
Notifications
You must be signed in to change notification settings - Fork 44
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
TypeError: Cannot read property 'path' of undefined #59
Comments
Hi @ha-akelius, have you checked with the plugin developer? anyway a stacktrace would be helpful. |
@kobik thank you for your reply, I didn't check the plugin developer my question (before asking the plugin developer) why we don't do a check for undefine in line |
I have meet the same issue. the server just crashed in this case. |
This happends when a
|
Yeah, as the plugin developer in question, @wxsms seems to be correct. Here's a minimal example case:
And here's the associated package.json:
And here's the stacktrace:
I think that there are completely valid non-user-error cases where a person would want to create a |
I think that a try catch should be applied inside the middleware. As a metrics tool it should not crash the app or block normal flow in any case, which makes user nervous. |
In the cases where the request route is not matched to any Koa route, bail out before trying to format the path string. Issue: PayU#59
* Check if properRoute is found before acting on it In the cases where the request route is not matched to any Koa route, bail out before trying to format the path string. Issue: #59 * Add test for koa middleware unmatched route scenario Issue: #59 * Add integration test for wildcard path scenario Issue: #59
we are working on Strapi and we are using strapi-plugin-prometheus-metrics
but we are getting
TypeError: Cannot read property 'path' of undefined
when the URL is not exist (status code is 404)is there a way to fix it?
The text was updated successfully, but these errors were encountered: