Ticket #1059 (closed Defect: fixed)

Opened 5 years ago

Last modified 5 years ago

dm4-webclient does not start in firefox due to "undefined topicmaps.get_topicmap(...)"

Reported by: Malte Owned by: jri
Priority: Major Milestone: Release 4.9
Component: DeepaMehta Standard Distribution Version: 4.8.5
Keywords: Cc: Malte
Complexity: 3 Area:
Module: deepamehta-webclient

Description

When i call the new DM 4.8.5 webclient with my firefox i get the following error and the webclient fails to initialize correctly leaving it unusable

uncaught exception: WebclientError: loading script /de.deepamehta.config/script/plugin.js failed (parsererror: TypeError: topicmaps.get_topicmap(...) is undefined)

I run Firefox 50.0.2 and tried it with multiple entry points (

  • blank as in requesting "/de.deepamehta.webclient/"
  • or straight into a specific topicmap like "/topicmap/144527"

In chromium i have no such error and the webclient starts nicely.

I think i remember (though i have no evidence at hand) that once the error message even came from another plugin (not from dm4-config) but from the dm4-accesscontrol plugin (the /de.deepamehta.accesscontrol/script/plugin.js script).

Can someone reproduce this?

Thanks for your support!

Change History

comment:1 Changed 5 years ago by jri

I can't reproduce this error with the DM standard distro in any of my browsers.

Possibly the problem originates from an installed 3rd-party plugin.

It could happen if a plugin performs this:

dm4c.add_plugin("some.plugin", function() {

    var topicmap = dm4c.get_plugin("de.deepamehta.topicmaps").get_topicmap()
})

Note that the loading order of plugins is non-deterministic. So, in the plugin's constructor function there is no guarantee that another plugin is loaded already. This is guaranteed only at init() time.

So, the proper form of the above example would be:

dm4c.add_plugin("some.plugin", function() {

    var topicmap

    dm4c.add_listener("init", function() {
        topicmap = dm4c.get_plugin("de.deepamehta.topicmaps").get_topicmap()
    })
})

Could this be the case for any of your 3rd-party plugins?

But ... oooh ... wait a moment ... note that already since DM 4.8.4 the initially displayed topicmap is not guaranteed to be available in any of the init() hooks at all. See #1039. Could this be the problem?

To narrow the problem down you could try starting with 3rd-party plugins deactivated.

comment:2 follow-up: ↓ 3 Changed 5 years ago by Malte

Yes, that may very well be the case. There are some not-yet-updated 3rd party plugins involved in this issue.

The error occurs here with Firefox:
http://wikidata-topicmaps.wmflabs.org/de.deepamehta.webclient/

I just reported it here (and stopped investigating) because of the stacktrace was mentioning the source of the error being the config plugin but maybe i was just fooled here by the javascript interpreter/runtime or so.

Will check if any of my old versions of 3rd party plugins may still carry this error, this "get_topicmap() is undefined" also sounds somehow familiar to me but i have to check all details...

Anyway, thanks for your investigation, very much appreciated.

comment:3 in reply to: ↑ 2 Changed 5 years ago by jri

Replying to Malte:

The error occurs here with Firefox:
http://wikidata-topicmaps.wmflabs.org/de.deepamehta.webclient/

Yes, there I see the error. And only with Firefox, just as you wrote. Strange.

In your "stableviews" plugin I recognize code like

topicmaps.get_topicmap()

But actually I see no problem with the code as it is wrapped in a condition.

I've installed "stableviews" and "dm4-littlehelpers" and have no problem with starting the Webclient. Also Firefox works.

So, what set of plugins is actually installed at wikidata-topicmaps.wmflabs.org ?

comment:4 Changed 5 years ago by Malte

  • Status changed from new to closed
  • Resolution set to fixed

So, what set of plugins is actually installed at wikidata-topicmaps.wmflabs.org ?

An old version of the "stableviews" plugin was the troublemaker. Updating it did the trick (and brought some updates to WTUI, e.g. http://wikidata-topicmaps.wmflabs.org/stableviews/memex/#333868)

Thanks for your help & Nice greetings!

Note: See TracTickets for help on using tickets.