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

  • SEARCH
  • Home
  • 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 8805483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:52:46+00:00 2026-06-14T01:52:46+00:00

Dojo 1.8 already defines AMD modules. For example you can do things like this:

  • 0

Dojo 1.8 already defines AMD modules. For example you can do things like this:

require(["dojo/_base/lang"], function (lang) {
  var ab = lang.mixin({a: 1}, {b: 2});
});

But how to I avoid getting an error when I attempt to import this module?

import lang = module ("dojo/_base/lang");

Is is possible?

  • 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-06-14T01:52:47+00:00Added an answer on June 14, 2026 at 1:52 am

    You will need a typescript definition file for lang. Assuming that lang.d.ts exists in the same directory as lang.js this code:

    import lang = module('dojo/_base/lang')
    
    var ab = lang.mixin({a: 1}, {b: 2});
    

    compiled with

    tsc --module amd yourfile.ts
    

    generates

    define(["require", "exports", 'dojo/_base/lang'], function(require, exports, __lang__) {
        var lang = __lang__;
        var ab = lang.mixin({a: 1}, {b: 2});
    }
    

    If you don’t want to have to match up the directory structures for whatever reason do this instead. Assuming lang.d.ts is in in a subdirectory called 3rd that is a sibling of test.ts.

    test.ts:

    ///<reference path="3rd/lang.d.ts"/>
    import lang = module('dojo/_base/lang');
    var ab = lang.mixin({a: 1}, {b: 2});
    

    3rd/lang.d.ts:

    declare module 'dojo/_base/lang' {
    ...
    }
    

    generates the same as above.

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

Sidebar

Related Questions

I've created a Dojo module which depends on dojox/data/JsonRestStore like this: define(my/MyRestStore, [dojo/_base/declare, dojox/data/JsonRestStore],
I am working on an application and was doing something like this: dojo.ready( function(){
JavaScript For example, I have the following JavaScript code (Dojo 1.6 is already loaded):
I have this string, which is generated by dojo.toJson() function: {page:accommodation task=viewList,language:undefined} When decoding
This seems like a problem someone would've already solved in the year 2009, but
dojo.addOnLoad(function(){ var jsonStore = new dojo.data.ItemFileReadStore({url:http://localhost:8080/Sai/samu}); }); <div dojoType=dijit.form.FilteringSelect store=jsonStore required=true id=MyId ></div> I
First of all there is a question/answer for this already: Constrain position of Dojo
I have this code: dojo.declare(City, null, { constructor : function(cityid, cityinfo){ } }); dojo.declare(TPolyline,
file: dojo/dir1/utils/XmlJsonUtils.js // Author: Rajat Khandelwal define([ dojo/_base/declare // declare ], function(declare){ return declare(dir1.utils.XmlJsonUtils,[],{
I have a dojo datagrid with datastore of json type. I have already accomplished

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.