Error "Parser return unfilled prom" in Dojo

I get the following error when used dojo/parserin my code.

parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin.

I have

define([
    "dojo/_base/declare",
    "dijit/_WidgetBase",
    "myApp/base/_TemplatedMixin",
    "dijit/_WidgetsInTemplateMixin",
    "dojo/text!../templates/MyTemplate.html",
    "dojo/i18n!../nls/Localized",
    "myApp/js/utils/hint",
    "dijit/form/ValidationTextBox",
    "dijit/form/SimpleTextarea",
    "dijit/form/Button",
    "dojo/parser",
    "dojo/domReady!"
], function (
    declare,
    _WidgetBase,
    _TemplatedMixin,
    _WidgetsInTemplateMixin,
    template,
    l10n,
    hint
) {

    'use strict';

    /**
     * @module
     */

    return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {

        widgetsInTemplate: true,

        /**
         * @description Localized object for view
         * @type {object}
         */
        l10n: l10n,

        /**
         * @description Custom template for view
         * @override
         */
        templateString: template,


        //postCreate: function () {
            //hint(l10n.hint);
        //}
    });

});

I did some research and realized that this could be related to dependencies and order. I added an attribute widgetsIntemplate, but still don't play dice. This only happens on the first page load.

Can anyone help?

+4
source share
2 answers

If you have widgets in your template, you need to make sure that they are all preloaded. Make sure your definition has all the widgets in your template.

+5
source

: - .

, dijit/form/FilteringSelect , store. , undefined.

.

  • , , .
  • try-catch buildRendering, , .
+1

Source: https://habr.com/ru/post/1526058/


All Articles