Open spabbineedi opened 6 years ago
Now I am able to load the WorkerClient..
replaced import 'brace/worker/worker_client';
with
var WorkerClient = ace.acequire('ace/worker/worker_client').WorkerClient;
but have some issues loading worker file
Could not load worker TypeError: Cannot read property 'id' of undefined at new WorkerClient (index.js:18003)
Do I need to convert the worker to
module.exports.id = 'ace/mode/json_worker';
module.exports.src = '..worker code'
to above style? If so, Is there a sample for it?
@spabbineedi hey did you ever figured this out?
@spabbineedi @rodobodolfo Did any of you were able to get it working?
I couldn't unfortunately.
@rodobodolfo
I was able to get it working by defining ace/worker/mirror
and ace/mode/custom_mode_worker
in the same file as mode (or importing it in that file) and using UIWorkerClient
instead of WorkerClient
like
new UIWorkerClient(['ace'], 'ace/mode/custom_mode_worker', 'CustomModeWorker');
PS - No idea if it would cause any problem but haven't encountered anything till now.
I have a custom mode and it has to load its own custom worker. I am trying to implement it using, createWorker method of the mode.
My mode file:
Error: Can't resolve 'brace/worker/worker_client'
Need help!