question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: callback function required

See original GitHub issue

Hi, when I add the viewengine to express like the following:

app.engine('html', jsrender.__express);
app.set('view engine', 'html');

I get this error:

Error: callback function required
    at EventEmitter.engine (/Users/daslicht/DEV/jsviews/isomorphic/node_modules/express/lib/application.js:294:11)
    at Object.<anonymous> (/Users/daslicht/DEV/jsviews/isomorphic/app.js:25:5)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:136:18)
    at node.js:963:3

It is teh same code as in your example, what am I missing please?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
iguerrero84commented, Oct 23, 2016

This error happended to me and i realized that it was missing a “require” for (‘consolidate’)

0reactions
BorisMoorecommented, Oct 23, 2016

@iguerrero84 - I didn’t understand you there. Were you getting the JsRender version 0.0.3 as a result of having a version of npm prior to 3.4.1? In that case you need to update npm then re-install JsRender.

Or was your error with a recent version of JsRender? (In which case can you explain where the require was missing - I don’t follow.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: callback function required - node.js - Stack Overflow
js:174 if ('function' != typeof fn) throw new Error('callback function required'); ^ Error: callback ...
Read more >
callback function required · Issue #6 · express-vue ... - GitHub
Hey! I'm getting this error: throw new Error('callback function required'); My code is the example code const http = require('http'); ...
Read more >
Error-First Callback in Node.js - GeeksforGeeks
The first argument in the function is reserved for the error object. If any error has occurred during the execution of the function,...
Read more >
[Solved]-Error: callback function required-mongodb
[Solved]-Error: callback function required-mongodb · score:1. Accepted answer. As you can see in log - error on line 7 app. · score:0. Had...
Read more >
data-error-callback | fastspringexamples
A JavaScript function you should provide, which will be invoked when an error is received from the backend. This function must accept 2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found