Results 1 to 8 of 8

Thread: TypeError: c is not a constructor

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    90
    Answers
    3

    Default TypeError: c is not a constructor

    Hi,
    I have a build an app with ExtJS 6.5.3 and tested it locally with the localhost. I have also moved the app to a webserver and tested it. All runs fine without any errors or console messages. Now I compiled the app with sencha app build, moved the compiled version to a webserver and when I try to start the app I get the above error message. The app also tries to load a file named ',js' from the root directory which doesnt exist.
    I have read through all the posts that had the same error message, but nothing has helped so far. The output from the build does not contain any line that contains a hint whether there is anything wrong.
    What would be the recommended approach to find the underlying issue?
    The line number reference in the debugger are not helpful, because they lead to the compiled/condensed code which is not readable anymore.
    Thanks for any hint.

  2. #2
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962
    Answers
    55

    Default

    The error you've described is usually indicative of a missing requires. If you run a testing build (sencha app build testing) that should help point out the culprit.

    Best!
    Bryan

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    90
    Answers
    3

    Default

    Quote Originally Posted by bjdurham85 View Post
    The error you've described is usually indicative of a missing requires. If you run a testing build (sencha app build testing) that should help point out the culprit.

    Best!
    Bryan
    Hi Bryan, I had done that but couldnt find any hint from the output (see below). In app.js I have a 'requires:['APPNAME.*']'. My understanding is that this takes care of everything and any Ext.* is automatically taken care of through the bootstrap?

    The outpu from Sencha CMD:
    C:APP>sencha app build testing
    Sencha Cmd v6.5.3.6
    [INF] Processing Build Descriptor : classic (testing environment)
    [INF] Loading compiler context
    [INF] Loading app json manifest...
    [INF] Processing data with ClosureCompressor
    [INF] JavaScript input level is NEXT and output level is ES5
    [INF] Writing concatenated output to file C:APP\build\testing\MMBB\classic\app.js
    [INF] merging 278 input resources into C:APP\build\testing\MMBB\classic\resources
    [INF] merged 1 resources into C:APP\build\testing\MMBB\classic\resources
    [INF] merging 57 input resources into C:APP\build\testing\MMBB
    [INF] merged 1 resources into C:APP\build\testing\MMBB

    [INF] Writing content to C:APP\build\temp\testing\MMBB\slicer-temp\bootstrap.json
    [INF] Writing content to C:APP\build\temp\testing\MMBB\slicer-temp\bootstrap.js
    [INF] writing sass content to C:APP\build\temp\testing\MMBB\slicer-temp\MMBB-example.scss.tmp
    [LOG] Fashion build starting for C:APP\build\temp\testing\MMBB\slicer-temp\MMBB-example.scss
    [LOG] Fashion build complete for C:APP\build\temp\testing\MMBB\slicer-temp\MMBB-example.scss
    [LOG] Fashion build completed in 9.629 sec.
    [INF] Capturing theme image
    [INF] Capture complete
    [INF] Slicing images...
    [INF] Slicing complete - generated 202 images
    [INF] Writing content to C:APP\build\temp\testing\MMBB\slicer-temp\bootstrap.json
    [INF] Writing content to C:APP\build\temp\testing\MMBB\slicer-temp\bootstrap.js
    [INF] writing sass content to C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss.tmp
    [INF] appending sass content to C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss.tmp
    [INF] appending sass content to C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss.tmp
    [INF] Writing content to C:APP\build\testing\MMBB\classic.json
    [LOG] Fashion build starting for C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss
    [LOG] Fashion build complete for C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss
    [LOG] Fashion build completed in 5.588 sec.
    [INF] Copying page resources to C:APP\build\testing\MMBB
    [INF] Writing content to C:APP\build\testing\MMBB\classic.json
    [INF] Writing content to C:APP\build\testing\MMBB\microloader.js
    [INF] Appending content to C:APP\build\testing\MMBB\microloader.js
    [INF] Building output markup to C:APP/build/testing/MMBB/index.html
    [INF] Writing content to C:APP\build\testing\MMBB\index.html
    [INF]
    [INF] ======================================================================
    [INF]
    [INF] Processing Build Descriptor : modern (testing environment)
    [INF] Loading compiler context
    [INF] Loading app json manifest...
    [INF] Processing data with ClosureCompressor
    [INF] JavaScript input level is NEXT and output level is ES5
    [INF] Writing concatenated output to file C:APP\build\testing\MMBB\modern\app.js
    [INF] merging 416 input resources into C:APP\build\testing\MMBB\modern\resources
    [INF] merged 1 resources into C:APP\build\testing\MMBB\modern\resources
    [INF] merging 47 input resources into C:APP\build\testing\MMBB
    [INF] merged 1 resources into C:APP\build\testing\MMBB

    [INF] Writing content to C:APP\build\temp\testing\MMBB\slicer-temp\bootstrap.json
    [INF] Writing content to C:APP\build\temp\testing\MMBB\slicer-temp\bootstrap.js
    [INF] writing sass content to C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss.tmp
    [INF] appending sass content to C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss.tmp
    [INF] appending sass content to C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss.tmp
    [INF] Writing content to C:APP\build\testing\MMBB\modern.json
    [LOG] Fashion build starting for C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss
    [LOG] Fashion build complete for C:APP\build\temp\testing\MMBB\sass\MMBB-all.scss
    [LOG] Fashion build completed in 13.997 sec.
    [INF] Copying page resources to C:APP\build\testing\MMBB
    [INF] Writing content to C:APP\build\testing\MMBB\modern.json
    [INF] Writing content to C:APP\build\testing\MMBB\microloader.js
    [INF] Appending content to C:APP\build\testing\MMBB\microloader.js
    [INF] Building output markup to C:APP/build/testing/MMBB/index.html
    [INF] Writing content to C:APP\build\testing\MMBB\index.html

  4. #4
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962
    Answers
    55

    Default

    Does it show anything in the browser from that testing build that stands out?

    **Not necessarily correct for the Ext.* part, you still should make sure anything you're using is required.

    Bryan

  5. #5
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    90
    Answers
    3

    Default

    Hi Bryan,
    thanks for the response. Will check the testing build and let you know.
    Re the Ext.* pieces: does this mean that I have to list all components (like buttons, containers, grids, etc) within the 'requires'? I always thought that this is done 'automatically' through the tracking in the classic/modern.json/.jsonp, i.e. Sencha cmd reads those files and compiles everything 'together'.

  6. #6
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    90
    Answers
    3

    Default

    Update:
    the error in the browser that I now get is:
    Error: [Ext.createByAlias] Unrecognized alias: plugin.gridfilters

  7. #7
    Sencha - Support Team bjdurham85's Avatar
    Join Date
    Mar 2014
    Posts
    962
    Answers
    55

    Default

    Step in the right direction, that's definitely a missing requires.

    Can you try adding "Ext.grid.filters.Filters" to your grid (or the first one you use) requires?

    Bryan

  8. #8
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    90
    Answers
    3

    Default

    Adding this
    requires: [ 'Ext.grid.filters.Filters'
    ],
    resolved the issue. The following questions remain:
    1. Why do I have to add a 'requires' for this component and nothing for others?
    2. Within docs.sencha.com searching for 'gridfilters' does not give any results, why?
    3. Same for 'treepanel' althoogh this and gridfilters are part of the alias?

Similar Threads

  1. TypeError: c is not a constructor
    By suwarjono in forum Ext 5: Bugs
    Replies: 2
    Last Post: 23 Aug 2016, 6:43 AM
  2. Uncaught TypeError: c is not a constructor
    By bluesky100 in forum Ext JS 6.x Q&A
    Replies: 5
    Last Post: 17 Jul 2016, 9:58 PM
  3. TypeError: Cls is not a constructor
    By wangqin in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 5 May 2015, 6:13 PM
  4. TypeError: App is not a constructor
    By JAD1951 in forum Ext: 4.x Beta
    Replies: 12
    Last Post: 10 Oct 2014, 7:03 AM
  5. TypeError: FilterClass is not a constructor
    By hz_qiuyuanxin in forum Ext: Discussion
    Replies: 3
    Last Post: 15 May 2013, 11:25 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •