You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Server is running on http://localhost:3000
URIError: URI malformed
at decodeURIComponent (<anonymous>)
at _decodeURI (file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/utils/url.js:132:38)
at _getQueryParam (file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/utils/url.js:171:14)
at HonoRequest.query (file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/request.js:41:12)
at prettyJSON2 (file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/middleware/pretty-json/index.js:5:26)
at dispatch (file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/compose.js:22:23)
at file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/compose.js:5:12
at file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/hono-base.js:195:31
at #dispatch (file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/hono-base.js:205:7)
at fetch (file:///Users/lincolnbergeson/Documents/GitHub/hono-demo/node_modules/hono/dist/hono-base.js:208:26)
Additional information
No response
The text was updated successfully, but these errors were encountered:
What version of Hono are you using?
4.7.2
What runtime/platform is your app running on? (with version if possible)
NodeJS v20.16.0
What steps can reproduce the bug?
prettyJSON calls
HonoRequest.query()
without a try clause, so when an invalid query parameter is passed, it throws theURIError: URI Malformed
error.Here is the code:
This code was obtained by running
npm create hono@latest
and adding two lines for importing and using prettyJSON.What is the expected behavior?
It should not throw an error
What do you see instead?
Making requests to the server throws the error as follows:
And the server logs:
Additional information
No response
The text was updated successfully, but these errors were encountered: