rails & markdown error: uncaught exception: Control.TextArea requires Object.Event to be loaded - ruby-on-rails

So, I've got bluecloth installed and I'm trying to use the Control.TextArea javascript WYSIWYG editor.
Anyways, I followed the tutorial on the page and when I load the corresponding view, I get an error:
uncaught exception: Control.TextArea requires Object.Event to be loaded.
This comes from Control.TextArea js file.
Any ideas? Thanks

Related

Vaadin 23 TypeError: error loading dynamically imported module

In Firefox browser, not always (but very often) I see the following error in the console (and page is unable to load):
TypeError: error loading dynamically imported module
Only after Ctrl + F5 the page is loaded correctly.
Also in the Network tab I may see the following:
Uncaught (in promise) TypeError: error loading dynamically imported module router.js:525:10
ready router.js:525
(Async: promise callback)
render router.js:517
__onNavigationEvent router.js:932
setRoutes router.js:419
index.ts:32
There is no any other information. In Chrome, everything works fine. What may be the reason of this issue?
I noticed this after upgrade to Vaadin 23.2.1
Also, from time to time I have the following error:

Summernote on Rails Production broken

I'm having some trouble with getting Summernote to work correctly on my production Rails environment (on Heroku). I'm using rails 4.2.0, bootstrap 4.1.3, and summernote-rails 0.8.10.0.
Everything works fine locally but is broken on production.
There are no errors when the editor loads but as soon as you click in to any of the text fields there are the following errors:
First-
Uncaught TypeError: Cannot read property 'hide' of undefined
at e.hide (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at e.update (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at e.invoke (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:142)
at e.update (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:140)
at HTMLTextAreaElement.summernote.mousedown (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:140)
at HTMLTextAreaElement.dispatch (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at HTMLTextAreaElement.m.handle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:32)
at Object.trigger (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at HTMLTextAreaElement.<anonymous> (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at Function.each (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:22)
Second-
Uncaught TypeError: t.slice is not a function
at i (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:139)
at e.current (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:139)
at e.currentStyle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:140)
at e.invoke (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:142)
at e.updateCurrentStyle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at e.invoke (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:142)
at HTMLTextAreaElement.<anonymous> (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:141)
at HTMLTextAreaElement.dispatch (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
at HTMLTextAreaElement.m.handle (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:32)
at Object.trigger (application-817b47c5cec07e4f230739dba0885233c6c215d78b973ccec6560fa46ec08080.js:33)
Both these js errors seem to be coming from Bootstrap.
Also, I guess it does "work" on production but it the extra input fields and just looks broken. Like so-
Anyone got any ideas? Thanks!
I upgraded to Rails 5 and that fixed the minification problem.

Highcharts more and highcharts guage issue

My high charts more is giving the following erro:
highcharts-more.js:29 Uncaught TypeError: I is not a function
I am calling the highcharts-more on the page with the folllowing:
https://code.highcharts.com/highcharts-more.js
I see that the highcharts-more file has been updated today. If I use the older version which is:
https://code.highcharts.com/4.2.2/highcharts-more.js
Then I start getting error in the solid-guage.js which is as follows:
solid-gauge.js:12 Uncaught TypeError: t is not a function
Plus the gayge fill color is not functioning properly as well.
Updating my local file highcharts.js to latest version solved the issue as, highcharts-more and solid-guage being called from website were updated to new versions along with highcharts.js.

Code from dart2js is throwing NoSuchMethodErrors for get$functions

My Polymer.dart web app, that works fine in Dartium, is giving the following error (it repeats seven times) when compiled with dart2js using pub build --mode=debug and loaded in Chrome.
Resource interpreted as Script but transferred with MIME type text/plain: "http://confab.dev/index.html_bootstrap.dart". confab.dev/:10
warning: file:///home/dan/projects/confabulous/webatara/web/index.html.0.dart library not found index.html_bootstrap.dart.js:17188
Uncaught Error: NoSuchMethodError: Cannot call "get$functions" on "#<JsLibraryMirror>" (Object #<JsLibraryMirror> has no method 'get$functions') index.html_bootstrap.dart.js:17188
Stack Trace:
TypeError: Object #<JsLibraryMirror> has no method 'get$functions'
at dart._loadLibrary (http://confab.dev/index.html_bootstrap.dart.js:20000:19)
at dart._loadLibraries (http://confab.dev/index.html_bootstrap.dart.js:19917:11)
at dart._initPolymerOptimized (http://confab.dev/index.html_bootstrap.dart.js:19908:7)
at dart.initPolymer (http://confab.dev/index.html_bootstrap.dart.js:19902:7)
at main (http://confab.dev/index.html_bootstrap.dart.js:4112:7)
at _IsolateContext.eval$1 (http://confab.dev/index.html_bootstrap.dart.js:1369:23)
at dart.startRootIsolate (http://confab.dev/index.html_bootstrap.dart.js:1145:21)
at http://confab.dev/index.html_bootstrap.dart.js:26514:7
at init.currentScript (http://confab.dev/index.html_bootstrap.dart.js:26494:5)
at http://confab.dev/index.html_bootstrap.dart.js:26508:3
index.html_bootstrap.dart.js:17188
Uncaught NoSuchMethodError: Cannot call "get$functions" on "#<JsLibraryMirror>" (Object #<JsLibraryMirror> has no method 'get$functions') index.html_bootstrap.dart.js:2369
Because source maps don't appear to work (they're turned on in Chrome, and I have .map files), I don't even know which part of my code is causing this.
I've tried with interop.js included both before dart.js, as the docs say, and after, as this issue says.
Looks like a bug in dart2js. Please file an issue, ideally with a reproducible test-case.
pub upgrade fixed it. It turns out that something had replaced the polymer 0.9.5 that I'd been using with 0.8.10+4. Quite odd. The solution to this is to set the polymer version as '>= 0.9.5' instead of 'any', which I will do eventually, but for now I'm interested to see if it happens again.

jquery ui autocomplete bugs - i can't make it work with json

By following the example of binaryhowl I've tried to make my autocomplete dynamic.
Source is here which should be of close resemblance (modified to fit the url I retrieve my info from).
lookup.php returns json compliant (UTF8) results as per (plaintext):
["value1","value2","value3","value4","value5"]
If I provide a hardcoded version of the url for source:
source: "lookup.php?type=some_case&value=search_term"
The autocomplete list of suggestions is piled up as expected.
Lookup.php supports
application/json; charset=utf-8
And I get the following bugs from jquery:
Uncaught TypeError: Object [object Object] has no method 'menu' jquery-1.5.1.js:869
Uncaught TypeError: Cannot read property 'element' of undefined jquery.ui.autocomplete.js:337
Uncaught TypeError: Cannot read property 'd' of null jquery-1.5.1.js:869
As seen here:
All js scripts are directly from here and here, etc.
I would recommend against picking and choosing jQueryUI components from the github repository you linked to. This error, for example:
Uncaught TypeError: Object [object
Object] has no method 'menu'
jquery-1.5.1.js:869 Uncaught
TypeError: Cannot read property
'element' of undefined
jquery.ui.autocomplete.js:337 Uncaught
TypeError: Cannot read property 'd' of
null jquery-1.5.1.js:869
Is because the autocomplete widget is trying to use the menu widget (an internal widget that is used by autocomplete).
I would recommend downloading the widgets you need using jQueryUI's download page, which will download the necessary files for the widgets you choose, or if you're using most of them, use jQueryUI hosted on a CDN.

Resources