New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not working in IISNode after 1.4.0 #281
Comments
Workaround is to use only the following in the jsreport.init().then(function () {
// running
}).catch(function (e) {
// error during startup
console.error(e.stack)
process.exit(1)
}) |
I can confirm the workaround works. |
The problem with iisnode is that it gives a unexpected value for Module {
id: '.',
exports: {},
parent: null,
filename: 'C:\\Program Files\\iisnode\\interceptor.js', I don't want to make the
if (process.env.JSREPORT_CLI) {
module.exports = jsreport
} else {
jsreport.init().then(function () {
}).catch(function (e) {
console.trace(e)
process.exit(1)
})
}
module.exports = jsreport.init().then(...).catch(...) and in jsreport reporter.init = function () {
if (process.env.JSREPORT_CLI) {
return Promise.resolve(this)
}
} @bjrmatos What are your thoughts? |
ugh nice catch i would prefer explicit export using the env |
I was exactly expecting this answer :) we can start with the first proposal, but I will still keep an eye if we won't find better solution in the end. |
yeah, i don't like either but i think it does the job very well, at least if you look at the file now you will think "ah ok this part is to make the jsreport cli work" (we even have a better hint now that we are going to use |
changes done, the change will be part of the next jsreport release |
Yes exactly, I believe this is now better with environment var because it gives hint why it is there. |
fixed in |
The cli introduced using
require.main
inside theserver.js
.Unfortunately the call
require.main !== module
is always true in the IISNode, so the application never starts.https://forum.jsreport.net/topic/57/iisnode-error-500
The text was updated successfully, but these errors were encountered: