Uh oh!
There was an error while loading. Please reload this page.
fix(app): validate render() callback and preserve mountpath on multiple mounts - #7355
Closed
webdevdot wants to merge 1 commit into
Closed
fix(app): validate render() callback and preserve mountpath on multiple mounts#7355webdevdot wants to merge 1 commit into
webdevdot wants to merge 1 commit into
Conversation
…le mounts Fixes two issues in application.js: - app.render() now throws a clear TypeError when callback is missing or not a function - app.mountpath is stored as an array when a sub-app is mounted at multiple paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This comment was marked as off-topic.
This comment was marked as off-topic.
krzysdz
commented
Jul 4, 2026
Contributor
Sorry, wrong tab |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug fail with text/plain #15 (
lib/application.js):app.render()called without a callback crashes with a crypticTypeError: done is not a functiondeep inside the rendering pipeline. This PR adds an early guard that throws a clearTypeError('app.render() requires a callback function')before any rendering starts.Bug Session support #16 (
lib/application.js): When a sub-app is mounted at multiple paths viaapp.use(['/a', '/b'], subApp), thefns.forEachloop overwrotefn.mountpathon each iteration, leaving only the last path. The fix accumulates paths into an array when the same sub-app is registered more than once.Test plan
app.render('view')with no callback throwsTypeError: app.render() requires a callback functionapp.render('view', fn)still works (callback as second arg)app.render('view', opts, fn)still works (normal usage)mountpathis a string (unchanged behavior)mountpathis an array containing both paths🤖 Generated with Claude Code