Uh oh!
There was an error while loading. Please reload this page.
fix(view): suggest npm install when view engine module is not found - #7356
Closed
webdevdot wants to merge 2 commits into
Closed
fix(view): suggest npm install when view engine module is not found#7356webdevdot wants to merge 2 commits into
webdevdot wants to merge 2 commits 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>
… engine When a view engine module isn't installed, require() throws a generic MODULE_NOT_FOUND error. Catch it and re-throw with an actionable message: "Run: npm install <engine>" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
krzysdz
commented
Jul 4, 2026
Contributor
Issue #17 is 17 years old and closed. What does it have to do with this PR? Why does this PR include #7355?
Well, it's a normal Node.js error that's rather easy to understand or look up in the internet. Besides, |
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 Static file serving #17 (
lib/view.js): When a template engine is not installed,require(mod)throws a rawMODULE_NOT_FOUNDerror that provides no guidance. The error is caught and re-thrown with a clear, actionable message:Non-
MODULE_NOT_FOUNDerrors (e.g., syntax errors inside the module) are re-thrown unchanged.Test plan
Error: Could not load view engine "pug". Run: npm install pug__expressstill throwsModule "x" does not provide a view engine.🤖 Generated with Claude Code