Open 61soldiers opened 3 years ago
I will be checking what is going on. Does the error mentioned follows a Stack trace? If so, can you please paste it here?
No, i passed in the error object as you can see from the code up there, it logs this
It just outputs MODULE_NOT_FOUND
Reinstalling Node fixes your problem? If not, trying reinstalling your node_modules please!
I found this. It may be helpful for Electron apps. I won't be able to check it right now, I believe I will try this solution over the week.
Don't think that will be helpful as i'm converting in the main process, anyways thanks for looking into it. I reinstalled ( Updated ) to the latest node 12 version ( as node 14 has breaking changes ) and reinstalled node_modules as you said, didn't work. Same error. Could be a problem with webpack but i'm not sure since the file is being converted in the backend ( main process ).
So, just dug a bit here and the problem is a little deeper than a initially thought. Node workers doesn't work natively in electron apps and the path system breaks with the latest version of it. I will need some more time to make a fix for it a probably use background workers instead for Chromium.
In main process
It works in development but once i build the electron app and try to convert that error shows up. Note: I also have a check to see if
ebook-convert
command can be executed so the conversion only runs if check returns true