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 9223119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:59:52+00:00 2026-06-18T03:59:52+00:00

I have simple class (with Dojo): define [dojo/request, dojo/html, dojo/on, dojo/dom], (request, html, observe,

  • 0

I have simple class (with Dojo):

define ["dojo/request", "dojo/html", "dojo/on", "dojo/dom"], (request, html, observe, dom) ->
   class Foo
     constructor: (@a) ->
       alert @a

I create a new object of this class at different file:

require ["Libraries/Foo", "dojo/domReady!"], (Foo) ->
   t = new Foo "test"

When I compile the Foo class file into JS, everything works without problem, but when I minify the JS output with for example http://jscompress.com code will broke up.

After minification code looks like:

// Generated by CoffeeScript 1.4.0
(function(){define(["dojo/request","dojo/html","dojo/on","dojo/dom"],function(e,t,n,r){var i;return i=function(){function e(e){this.a=e;alert(this.a)}return e}()})}).call(this);

At console (Safari, Chrome) I can see:

TypeError: '[object Object]' is not a constructor (evaluating 'new Foo("test")')

But when I reformat code using tool at my IDE, everything works OK.

Code after reformation:

// Generated by CoffeeScript 1.4.0
(function () {
    define(["dojo/request", "dojo/html", "dojo/on", "dojo/dom"], function (e, t, n, r) {
        var i;
        return i = function () {
            function e(e) {
                this.a = e;
                alert(this.a)
            }

            return e
        }()
    })
}).call(this);

Where can be problem please?

  • 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-18T03:59:53+00:00Added an answer on June 18, 2026 at 3:59 am

    Problem solved! Using async: true in Dojo config.

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

Sidebar

Related Questions

I have a simple class which starts 3 threads and saves a new object
I have simple class with width and height member fields which define number of
I have a simple class that contains the required properties for a request to
I have simple class ina header file: > cat Algorithms.hh #ifndef Algorithms_hh #define Algorithms_hh
I have simple class in a header file: a.hh #ifndef a_hh #define a_hh class
I have a simple class which has boolean field: public struct Foo { bool
I'm new to entity frame work code first. I have simple class called Cat
I have a simple class which has a static constructor and a instance constructor.
I have the simple class using auto-implemented properies: Public Class foo { public foo()
I have a simple class Student under namespace School. namespace XmlTestApp { public class

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.