Error thrown when closing blocks in diffrent ways
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 37
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
/node_modules/pejs/codegen.js:38
tree.forEach(function(node) {
^
TypeError: Cannot call method 'forEach' of undefined
at stringify (/node_modules/pejs/codegen.js:38:8)
at /node_modules/pejs/codegen.js:59:54
at Array.forEach (native)
at stringify (/node_modules/pejs/codegen.js:38:8)
at /node_modules/pejs/codegen.js:59:54
at Array.forEach (native)
at stringify (/node_modules/pejs/codegen.js:38:8)
at codegen (node_modules/pejs/codegen.js:67:12)
at /node_modules/pejs/index.js:93:48
at /node_modules/pejs/sequence.js:11:12
The above error is thrown when trying to render the following template.
<%{ header %>
<% }%>
<%{ body %>
<%} %>
It somehow related to how the blocks are closed. The below template, for example, doesn't throw (notice how the blocks are closed).
<%{ header %>
<%} %>
<%{ body %>
<% }%>
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the error with the two template examples and start at node_modules/pejs/codegen.js:38, following the calls through index.js and sequence.js. Compare the two block-closing forms and verify that both templates render without the TypeError while the already-working form continues to render.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100