Open zachbwh opened 5 years ago
hi! according to logs there is something that is initializing two logger instance during startup. the first that comes to my mind is that your server.js
is not correctly handling some initialization code that makes our cli and migration tool to work correctly, can you update your server.js
file to something like this and try again?
const jsreport = require('jsreport')()
if (process.env.JSREPORT_CLI) {
// export jsreport instance to make it possible to use jsreport-cli
module.exports = jsreport
} else {
jsreport.init().then(() => {
// running
}).catch((e) => {
// error during startup
console.error(e.stack)
process.exit(1)
})
}
Some system context:
I am trying to migrate my configuration to jsreport v2 but the tool crashes at several stages.
Firstly, after confirming I am ready to start I get this error:
I believe I have fixed this by changing my server.js slightly to export the jsreport instance but I'm including it in this issue in case I have done it incorrectly.
After making that change, I am able to progress slightly further and can answer the prompt "should we continue"
I'm not sure if there is something wrong with how my jsreport server is set up or if the migration tool is broken. I recently upgraded from jsreport 1.4 to 1.10 but everything seems to be running correctly when I run
jsreport start
ornode server.js
Any help would be greatly appreciated.