admin管理员组文章数量:1279148
I'm getting the following error when using dojo/parser
in my code.
parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin.
I've
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've done some research and realized it may have to do with dependencies and order. I've added the widgetsIntemplate
attribute but still no dice. This only happens on first load of the page.
Can anyone help?
I'm getting the following error when using dojo/parser
in my code.
parser returned unfilled promise (probably waiting for module auto-load), unsupported by _WidgetsInTemplateMixin.
I've
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've done some research and realized it may have to do with dependencies and order. I've added the widgetsIntemplate
attribute but still no dice. This only happens on first load of the page.
Can anyone help?
Share Improve this question asked Aug 6, 2014 at 19:14 streetlightstreetlight 5,96813 gold badges66 silver badges102 bronze badges2 Answers
Reset to default 9If you have widgets in your template, you have to make sure they are all preloaded. Make sure your define has all the widgets in your template.
For future readers: This error message may also be thrown when creating one of the widgets in the template fails to any other reason.
For example I had a dijit/form/FilteringSelect
in a template and had a typo in the variable I passed to its store
property. So the store was undefined.
It can be quite hard to find the source of this error message sometimes.
- Successively remove widgets from the template to identify the one that causes the problem.
- Instance the widget programatically inside a try-catch block inside your own
buildRendering
function to see what is actually going wrong.
本文标签: javascript39Parser returned unfilled promise39 error in DojoStack Overflow
版权声明:本文标题:javascript - 'Parser returned unfilled promise' error in Dojo - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741267341a2368726.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论