-1

I'm using NVD3 with sencha touch (2.3.1), and after building for production I get the error mentioned in the title.

I did everything according to the instructions: https://github.com/woodenconsulting/OpenCharts-For-Sencha-Touch-and-ExtJS.

I noticed that the Sencha CMD has obfuscated the files of the library (d3.min.js and nv.d3.min.js), into the build folder, for example, the file: d3.min.js.

The original file starts with this: !function(){function n(n){return null!=n&&!isNaN(n)}...

After build it become like this: function _17932636d3fbdb626cc81cd279db37fe71ecf72d(){};!function(){function hY(a){return null!=a&&!isNaN(a)}...

Does anyone have any idea what could be?

Thanks!

user3667143
  • 61
  • 1
  • 1
  • 4
  • Please try to find an answer via google (or the search field on StackOverflow) before you post a question. I googled "nvd3 ReferenceError: nv is not defined" and the first hit was [a gitHub issue about ReferenceError: nv is not defined](https://github.com/angularjs-nvd3-directives/angularjs-nvd3-directives/issues/89). – Martin Apr 22 '15 at 12:11
  • possible duplicate of [NVD3.js: ReferenceError: nv is not defined](http://stackoverflow.com/questions/29676076/nvd3-js-referenceerror-nv-is-not-defined) – Martin Apr 22 '15 at 12:12
  • Hi! Thank you for you answer. I had already tried to find on google and already had found this site. But this is not the same case that mine. The problem happens just after build (Using sencha CMD). I don't include the file in the html. I did this editing the app.json and including the OpenCharts 'ref' in the app.js requires. – user3667143 Apr 22 '15 at 14:16

1 Answers1

0
Solved!

I included the option "includeInBundle":true in the path in the app.json.

"js": [
        {
            "path": "OpenCharts/lib/d3.min.js",
            "includeInBundle":true
        },            {
            "path": "OpenCharts/lib/nv.d3.min.js",
            "includeInBundle":true
        },
        .
        .
        .
        .
],

Thanks
user3667143
  • 61
  • 1
  • 1
  • 4