Error shown as below
TypeError: Jimp.read is not a function
at eval (webpack:///./node_modules/replace-color/src/replace-color.js?:43:10)
at new Promise (<anonymous>)
at module.exports (webpack:///./node_modules/replace-color/src/replace-color.js?:20:10)
at IpcMainImpl.eval (webpack:///./src/background.js?:222:5)
And my code in the background.js is
var replaceColor = require('replace-color')
replaceColor({
image: path_to_image,
colors: {
type: 'hex',
targetColor: targetColor,
replaceColor: '#00000000'
},
deltaE: 10
})
...
I trace the error message, and found the error is happened when reading the image.
which is in the node_modules/replace-color/src/replace-color.js line 43
I tried many ways including add async await stuff to make the process sync, but it is still not working.
Then no idea how to solve it.
Error shown as below
And my code in the
background.jsisI trace the error message, and found the error is happened when reading the image.
which is in the
node_modules/replace-color/src/replace-color.jsline 43I tried many ways including add
async awaitstuff to make the process sync, but it is still not working.Then no idea how to solve it.