CodeMirror plugin javascript error/bug?

75 views
Skip to first unread message

stefano franchi

unread,
Mar 5, 2019, 10:17:39 AM3/5/19
to tiddl...@googlegroups.com
I just discovered that when I try to fold all tiddlers with the Codemirror plugin installed, TW crashes with the following error:

Internal JavaScript Error

Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
Error executing boot module $:/plugins/tiddlywiki/codemirror/addon/hint/css-hint.js: "Cannot find module named '../../mode/css/css' required by module '$:/plugins/tiddlywiki/codemirror/addon/hint/css-hint.js', resolved to $:/plugins/tiddlywiki/codemirror/mode/css/css" undefined

I am not sure which file is missing but there seems to be no mode/css/css item anywhere in the codemirror plugin tree

S.





--
__________________________________________________
Stefano Franchi

stefano...@gmail.com
http://stefano.cleinias.org

stefano franchi

unread,
Mar 5, 2019, 10:19:49 AM3/5/19
to tiddl...@googlegroups.com
On Tue, Mar 5, 2019 at 9:17 AM stefano franchi <stefano...@gmail.com> wrote:
I just discovered that when I try to fold all tiddlers with the Codemirror plugin installed, TW crashes with the following error:

Internal JavaScript Error

Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser
Error executing boot module $:/plugins/tiddlywiki/codemirror/addon/hint/css-hint.js: "Cannot find module named '../../mode/css/css' required by module '$:/plugins/tiddlywiki/codemirror/addon/hint/css-hint.js', resolved to $:/plugins/tiddlywiki/codemirror/mode/css/css" undefined

I am not sure which file is missing but there seems to be no mode/css/css item anywhere in the codemirror plugin tree

S.



Although a brief trip to codemirror's own repo on github shows that in fact there is a mode/css/css.js file. I wonder if it somehow did not make it into the plugin?

PMario

unread,
Mar 5, 2019, 10:55:40 AM3/5/19
to tiddl...@googlegroups.com
Hi,

Have a look at the ControlPanel: Plugin -tab here: https://tiddlywiki.com/plugins/tiddlywiki/codemirror/#%24%3A%2FControlPanel

May be you missed to install some dependencies. ... There is no automatic dependency resolving mechanism. atm. ... We don't have the tools to create one at the moment.

-m

stefano franchi

unread,
Mar 5, 2019, 11:14:53 AM3/5/19
to tiddl...@googlegroups.com
On Tue, Mar 5, 2019 at 9:55 AM PMario <pmar...@gmail.com> wrote:

May be you missed to install some dependencies. ... There is no automatic dependency resolving mechanism. atm. ... We don't have the tools to create one at the moment.


Thanks for the hint. The missing file was hidden in the Code Mirror CSS Highlighting additional plugin. Installing it solved the issue.


Cheers,

S.

BurningTreeC

unread,
Mar 5, 2019, 11:21:54 AM3/5/19
to TiddlyWiki
@pmario, I think we should add red sign on the install banner when you click on open plugin-library ...

if those cm addons get a field "depends-on" we could show its content if the field exists

PMario

unread,
Mar 5, 2019, 2:45:39 PM3/5/19
to TiddlyWiki
On Tuesday, March 5, 2019 at 5:21:54 PM UTC+1, BurningTreeC wrote:

@pmario, I think we should add red sign on the install banner when you click on open plugin-library ...

Yea, we need to do something. ... If I use CM I always start with the edition, because I don't want to deal with the dependencies :)
 
if those cm addons get a field "depends-on" we could show its content if the field exists

BUT I don't want to create the dependency-list by hand. It will be a maintenance nightmare for us. ... I think the requires(xxxx) statements from the upstream library should give us the info. So we can automatically create some visual info, if something is missing.

just some thoughts.

-m

BurningTreeC

unread,
Mar 5, 2019, 3:28:43 PM3/5/19
to TiddlyWiki
and/or we put a try { require(...) } catch(e) { $tw.notifier.notify(dependency xy missing, plz install addon so-und-so); return false; } ino the addons?

the base editor could hold a list or data-tiddler with all addons with the corresponding js-tiddler names that get required, so the addons can lookup which addon is missing ...

PMario

unread,
Mar 5, 2019, 4:56:52 PM3/5/19
to TiddlyWiki
On Tuesday, March 5, 2019 at 9:28:43 PM UTC+1, BurningTreeC wrote:
and/or we put a try { require(...) } catch(e) { $tw.notifier.notify(dependency xy missing, plz install addon so-und-so); return false; } ino the addons?

this may be an option. ... but plugin activation order should be resolved automatically.
 
the base editor could hold a list or data-tiddler with all addons with the corresponding js-tiddler names that get required, so the addons can lookup which addon is missing ...

I think engine.js could be able to handle it, even if we need to provide more info in plugin.info.

-m

BurningTreeC

unread,
Mar 8, 2019, 5:34:18 AM3/8/19
to TiddlyWiki
Isn't the only thing required that the configuration tiddlers are loaded in the correct order? We could just add list-before's ... it already gets the config tiddlers by filtering

I made a tiddler that lists all dependencies, it's not that complicated. I attached it below
codemirror addon dependencies.json

BurningTreeC

unread,
Mar 8, 2019, 5:38:47 AM3/8/19
to TiddlyWiki

On Tuesday, March 5, 2019 at 9:28:43 PM UTC+1, BurningTreeC wrote:
and/or we put a try { require(...) } catch(e) { $tw.notifier.notify(dependency xy missing, plz install addon so-und-so); return false; } ino the addons?

this may be an option. ... but plugin activation order should be resolved automatically.
 
the base editor could hold a list or data-tiddler with all addons with the corresponding js-tiddler names that get required, so the addons can lookup which addon is missing ...

I think engine.js could be able to handle it, even if we need to provide more info in plugin.info.

-m

Isn't the only thing required that the configuration tiddlers are loaded in the correct order? We could just add list-before's ... it already gets the config tiddlers by filtering

ah no, I see now that that's not right. the order they get required is important and currently it just requires them "how they come"
Reply all
Reply to author
Forward
0 new messages