Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6025423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:17:56+00:00 2026-05-23T04:17:56+00:00

I have a custom dijit that loads fine when debugAtAllCosts = true , but

  • 0

I have a custom dijit that loads fine when debugAtAllCosts = true, but fails when debugAtAllCosts = false with this error:

 failed loading script/dojo15root/dojo/../../widget/DatePicker.js 
 with error: TypeError: dojo.body() is undefined

I know that using debugAtAllCosts = true makes dojo use the XD loader which loads modules asynchronously. So normally people have problems when they go from the synchronous to asynchronous loader. What kind of bug should I be looking for when the widget loads fine with the asynchronous loader, but does not load with the synchronous loader?

I could post the code, but it is composed of a lot of different js files and other widgets that could also be the problem. So at this point I’m trying to narrow the problem by figuring out when this problem could occur.

My djConfig when the widget fails to load:

<script type="text/javascript">
    var djConfig = {
        parseOnLoad: true,
        isDebug: true,
        locale: 'en-us',
        debugAtAllCosts:false,
        modulePaths:{'widget':'../../widget','datepicker':'../../datepicker'}
    };
</script>

My djConfig when the widget loads:

<script type="text/javascript">
    var djConfig = {
        parseOnLoad: true,
        isDebug: true,
        locale: 'en-us',
        debugAtAllCosts:false,
        modulePaths:{'widget':'../../widget','datepicker':'../../datepicker'}
    };
</script>

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T04:17:57+00:00Added an answer on May 23, 2026 at 4:17 am

    After reading about the different loader strategies, I figured my problem had to be with instantiating a dijit in some javascript code before the file had been loaded.

    Turned out the offending line was here:

    dojo.provide("widget.DatePicker");
    
    dojo.require("dijit._Widget");
    dojo.require("dijit._Templated");
    dojo.require("dijit.Dialog");
    
    dojo.declare("widget.DatePicker", [dijit._Widget, dijit._Templated],  {
    
        ...
    
        //private fields
        _dialogBox:new dijit.Dialog({
            title: "Warning!"
        }),
    
        ...
    
    });
    

    I fixed it by moving the instantiation into the postCreate function so as to be sure the widget and all “require”s would be loaded.

    I’m still not 100% sure why the standard loader would exhibit this problem, because by my understanding it loads things synchronously; whereas the XD loader loads asynchronously. My guess is that during the widget lifecycle, the widget attributes get created before the widget’s “require”s are loaded. But that doesn’t explain why the XD loader would work in this situation…

    If someone can explain why the XD loader works, when the standard loader fails in this situation, I would gladly accept that answer. Otherwise, I’ll accept my answer because it does fix the problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom errors configured in my web.config, but IIS 6.0 is returning the
I have a few models that need to have custom find conditions placed on
hi i would like to create a custom calendar, this calendar will have custom
I have a custom control that implements IPostBackEventHandler. Some client-side events invoke __doPostBack(controlID, eventArgs).
I have a custom installer action that updates the PATH environment, and creates an
We have a custom-built Flash-based video player that I maintain, and it needs to
I have developed a custom dijit Templated Widget. I have to do some DOM
I have custom validators and filters that I have created that I would like
I have some problems getting the custom formated JSON data into a dijit.form.FilteringSelect. It
We have written an Outlook add-in in C#, that appends a custom header to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.