DEV Community

Discussion on: Error: [nodemon] app crashed - waiting for file changes before starting...

Collapse
 
hafizsaifullah profile image
Hafiz Saifullah

Thanx to @Garret, I have resolved my issue by replacing

const rootChain = JSON.parse(body);
console.log('replace transaction pool map on a sync with', rootChain);
blockchain.replaceChain(rootChain);

with

function safeParse (body) {
                const rootChain = JSON.parse(body);
                console.log('replace transaction pool map on a sync with', rootChain);
                blockchain.replaceChain(rootChain);
}