SWISH typeahead problems

11 views
Skip to first unread message

Smoked Haddock

unread,
Apr 18, 2017, 5:32:35 AM4/18/17
to SWI-Prolog
Hi there,

Apologies if this is duplicated, I thought I posted yesterday. Anyways...

I've built swipl-devel and swish from git, and all works fine on my local Ubuntu 14.04 desktop, but I get a curious problem with SWISH's javascript if I do the same on a Ubuntu 16.04 in the cloud, This link should work http://meme-machines.com:3050

The front page starts to load but doesn't finish..

JS console

Uncaught TypeError: Cannot read property 'factory' of undefined
    at init (:3050/js/swish.js:76)
    at fn (require.js:1392)
    at Object.execCb (require.js:1693)
    at Module.check (require.js:881)
    at Module.enable (require.js:1173)
    at Module.init (require.js:786)
    at callGetModule (require.js:1200)
    at Object.completeLoad (require.js:1608)
    at HTMLScriptElement.onScriptLoad (require.js:1714)


swish.js

    { deps:["jquery"],
      init: function ($) {
return require.s.contexts._.registry['typeahead.js'].factory($);
      }
    },

Is there some configuration oversight that could be corrected? Hope someone can help... I'm baffled!

Best wishes


Chris

Jan Wielemaker

unread,
Apr 18, 2017, 6:06:40 AM4/18/17
to Smoked Haddock, SWI-Prolog
I did a recent update of the JavaScript dependencies in the latest
SWISH. Unfortunately this requires you to use the old versions of
everything or the new versions of everything (everything meaning SWISH
and the dependencies installed through bower). I think you should be ok
using the latest SWISH git and the latest bower dependencies installed.
Considering all the changes, I've removed web/bower_components and
re-ran `bower install`, possibly you need `bower update`. The zip file
with dependencies on swi-prolog.org has the latest versions.

This is a compatibility between swish, require.js and typeahead caused
by the fact that typeahead's module naming is incompatible with
require.js. If you have a better solution, please provide it ...

Surely all works fine on Ubuntu 16.04 as that is what two of my
development machines are running.

Cheers --- Jan

Smoked Haddock

unread,
Apr 18, 2017, 6:16:42 AM4/18/17
to SWI-Prolog, chris....@zigzag.co.uk
Yet again, thanks for such great support!

Smoked Haddock

unread,
Apr 18, 2017, 9:18:07 AM4/18/17
to SWI-Prolog, chris....@zigzag.co.uk
Just to confirm that all works fine. Stay tooned!
Reply all
Reply to author
Forward
0 new messages