Error: Module name "sharemaps_drawonmaps_elgg_js" has not been loaded yet for context: _

Hi!

I'm trying to use the Sharemaps plugin to create and edit the user maps. Cannot to resolve the issue..

Error: Module name "sharemaps_drawonmaps_elgg_js" has not been loaded yet for context: _ https://requirejs.org/docs/errors.html#notloaded

This is looks strange for me but looks like plugin depends froms the self?

 

drawonmaps_elgg.js

define(function (require) {
    var elgg = require('elgg');
    var $ = require('jquery');
    
    require('sharemaps_googleapis_js');
    require('sharemaps_prettify_js');
    require('sharemaps_drawonmaps_elgg_js'); -- This is the error place

 

 views.php

<?php
/**
 * Elgg ShareMaps plugin
 * @package sharemaps
 */
 
return [
    'default' => [
    'sharemaps_drawonmaps_elgg_js.js' => __DIR__ . '/vendors/drawonmaps/drawonmaps_elgg.js',
    'sharemaps_gmaps_js.js' => __DIR__ . '/vendors/drawonmaps/gmaps.js',
    'sharemaps_prettify_js.js' => __DIR__ . '/vendors/drawonmaps/prettify.js',
    'sharemapsps_api/graphics/' => __DIR__ . '/graphics',
    ],
];

Possibly the issue exist from timeout or form loop in the required info?

Please any ideas?

 

  • Hopefully found the solution!

    Added the depends string to the sharemaps_gmaps_js

        elgg_define_js('sharemaps_gmaps_js', array(
           'deps' => array('sharemaps_googleapis_js'),
            'exports' => 'sharemaps_gmaps_js',
       ));

     

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking