-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Jsoneditor code mode requires worker-json.js from the absoute path not from the relative #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry, My bad, I have renamed all the ace included libraries to .min.js which lead to error in showing worker json error. |
It seems that there is still an issue when loading from HTML Import.
Example here: http://juicy.github.io/juicy-jsoneditor/worker-json_bug.html |
That is an interesting one. This missing |
Well according to W3C HTML Import spec, browser loads resources from location relative to importing document. So it works nice for all regular |
There is no magic there, Ace uses require.js/AMD for (dynamic) module loading, though this particular issue is about running a Web Worker. This web worker is instantiated by Ace here. It creates a WorkerClient, which creates an HTML5 Web Worker from a relative url here. Polymer doesn't know about this relative url and so it isn't updated and breaks your application. I'm not sure, but I can try whether the code for the web worker can be packaged together with the other modules, so there is no dynamic loading needed. |
Anyone have any luck with this? Trying to solve #157 and this seems to be related. Thanks! |
@smartameer and @tomalec I've just refactored the JSONEditor to CommonJS modules and using brace (see #157 (comment)). This could resolve the problems when using the editor inside Polymer. Could you maybe give the version in the develop branch a try? |
I'm having essentially the same issue when doing a gulp build from bower packages. Since the build minifies all vendor code into a single vendor.js file the worker-json.js is included inline, but Ace still tries to load it as a file dynamically and 404s. Anyone have any ideas on how to get around this? |
Still getting this error, in angular 5. |
How can I reproduce the issue? |
Hi,
I was using json-editor in "code" mode which is requiring worker-json.js
I have my scripts folder from where ace.min.js is loading, but it requires worker-json.js which is also in scripts directory, but dom error says that it's being requested from absolute url instead of scripts directory. May i know why this worker-json is required when https://github.com/josdejong/jsoneditor/blob/master/examples/03_switch_mode.html says no need of worker-json.js for code mode.
My Script block is
I am using angularjs above this editor.
The text was updated successfully, but these errors were encountered: