madhums / madhums/node-view-helpers

Get RangeError when used with multiple mounts

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
81
Forks
21
PR merge metrics
No merged PRs in 30d

Description

# Error Reported

RangeError: Maximum call stack size exceeded
at RegExp.test (native)
at ServerResponse.res.render [as _render]
## Happens when I use multiple mounts.
### e.g

var app = express()
...
app.use(helper('appName))
app.use(appRouter)
### mount 1

server.use(app)

var admin = express()

//same name or different name does not matter
admin.use(helper('appName'))

//all routes fails in 'res.render()' call with above error
app.use(adminRouter)
### mount 2

server.use(admin)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the RangeError with the two mounted Express apps shown in the issue, using helper('appName') and a route that calls res.render. Trace the helper and render path while comparing the app and admin mounts. Done means the multiple-mount example renders without exceeding the call stack.

Written by the indexing model from the issue text.

Assessment

Tech stack
express, javascript, node.js
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.