I asked for this error on GitHub as an issue @laurent22 said that it's more of a support request so I'm asking here for support or any resources that can help.
I'm trying to develop a basic Joplin Plugin which simply takes an image and generate the OCRed text using tesseractjs
I tried the code of tesseractjs in a separate script using Node and it works fine so it's not a tesseract issue but when I add the script to the plugin it throws the following error:
@roman-r-m replied with the following:
"
Yep, tried that too.
You need to see what createWorker does: it forks a new node process passing it a certain script.
Now, you have 2 issues there:
That script is not bundled with your plugin - this you can solve by fiddling with webpack config (at least that's how I did it)
You need to provide the correct script to that fork method. However due to how Joplin executes plugin scripts this was not trivial, don't remember in details why exactly."
but I can't figure out what should I do? can you recommend me any resources to read more about the problem?
If this is for GSoC then maybe you should start with something easier? This is by no means a basic plugin.
Otherwise best resources are tesseract.js and Joplin sources.
I've outlined what's required to get it to work (I think, might be completely wrong).
UPD
Just remembered, I think there was also webassembly involved for extra fun.
I'm applying for the project in GSoC but this is just a very basic try to get familiar with the challenges that I may face so I can write a better proposal for the project
@roman_r_m
I'm sorry for asking so many questions, I appreciate your time in responding to whatever you can. What do you mean by that script? do you mean the tesseract core script?
I tried to provide the absolute path of tesseract, worker, and tesseract core
I don't remember in details, sorry. The script I meant is the one that tesseract.js passes to the forked process. You'll have to read the source code to find it.
The error you got - I do not recall ever seeing it.
One more thing to note is if you want to build a proper plugin not just for dev experiments, then you can't access node_modules because it won't be packaged into the .jpl file.