When a Resource class exported by harper/redirects (or similar) is POSTed to without a trailing slash, super.post() throws an unhandled exception:
Cannot read properties of undefined (reading 'query')
With a trailing slash but a random path segment (e.g. /redirects/hi), the error changes slightly:
Cannot read properties of null (reading 'query')
Context
- Trailing slash IS required per design and this is documented — it's not a missing-feature issue.
- The problem is the unhandled exception surfacing to
super.post() rather than a clean 404 or 405.
- Was silently working in 4.3; broke in 4.5 in a way that erodes confidence.
Ask
Catch the missing-trailing-slash case in the Resource request dispatch and return an appropriate HTTP error (404 or 405 with a clear message) rather than letting the Cannot read properties of undefined exception propagate.
🤖 Filed by Claude on behalf of Kris.
When a Resource class exported by
harper/redirects(or similar) is POSTed to without a trailing slash,super.post()throws an unhandled exception:With a trailing slash but a random path segment (e.g.
/redirects/hi), the error changes slightly:Context
super.post()rather than a clean 404 or 405.Ask
Catch the missing-trailing-slash case in the Resource request dispatch and return an appropriate HTTP error (404 or 405 with a clear message) rather than letting the
Cannot read properties of undefinedexception propagate.🤖 Filed by Claude on behalf of Kris.