this.render is not a function
See original GitHub issueI’m using koa@2 and getting _this.render is not a function
this.render('index')
Doing ctx.render does work but I need to specify ‘index.pug’ and not just ‘index’. Also, not if it is related but string interpolation no longer works.
p.text-xs-center $ #{product.price}
Just outputs #{product.price} after it’s converted to html.
package.json
{
"koa": "^2.0.0",
"koa-pug": "^3.0.0-0"
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React Context: TypeError: render is not a function
The problem is I seem to be getting an error 'TypeError: render is not a function. (In render(newValue), render is an instance of...
Read more >render is not a function????? (Example) - Treehouse
render is not a function ????? I am try Use Context API but having this Strange error. Context/index.js. const AmazonContext = React.
Read more >Scene.render() is not a function - Questions - Babylon.js Forum
I just copied an example on Playground and pasted it on my editor to run it on local, but it keeps saying “scene.render()...
Read more >The child node of a React context consumer ... - DeepScan
The child node of a context consumer should be a function that takes the current context ... (TypeError: render is not a function)...
Read more >document.getElementById(...).render is not a function - React.js
I wasted again another hour of my life finding this solution.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
koa-pug
is not fully supportkoa@2
yet, though it can work.koa@2
usesctx
instead ofthis
for context of one request, please usectx.render
instead: https://github.com/koajs/koa/tree/v2.x#old-signature-middleware-v1x---deprecated ..pug
extname and string interpolation, can you post your codes? I can’t reproduce these issues.It is a bug of
Pug
, and fixed inalpha7
: https://github.com/pugjs/pug/commit/2d79b88c9b4e37f1593c6d2ec7c79104df1b7c68 .There’re two solutions:
npm ^3.7
, you can runnpm i pug@2.0.0-alpha7
koa-pug
,npm
will install latestPug
for you.