Skip to content

Modules Are Empty Objects #271

@pixelshaded

Description

@pixelshaded

The script tags:

<script src="~/Scripts/curl.js"></script>
<script src="~/Areas/Analytics/Scripts/Charting/ChartingMain.js"></script>

ChartingMain:

curl({ baseUrl: "/" }, ["Areas/Analytics/Scripts/Charting/ChartingApp"], function (ChartingApp) {
    var chartingApp = new ChartingApp();
});

ChartingApp:

define([
"require", 
"exports",
"Areas/Analytics/Scripts/Charting/ChartViewModel",
"Areas/Analytics/Scripts/Routing/RouteManager",
"Areas/Analytics/Scripts/Charting/FusionCharts/DualYCombination2D",
"Areas/Analytics/Scripts/Charting/FusionCharts/Column2D",
"Areas/Analytics/Scripts/Charting/KendoDataViz/DataVizConfigGenerator",
"Areas/Analytics/Scripts/Charting/KendoDataViz/DataVizRenderer",
"Areas/Analytics/Scripts/Charting/FusionCharts/FusionChartRenderer"
], function(
require,
exports,
ChartViewModel,
RouteManagerImpl,
DualYCombination2D,
Column2D,
DataVizConfigGenerator,
DataVizRenderer,
FusionChartRenderer
) { 
//some code
});

If I look in the network tab of the chrome debugger, I can see that the charting app modules are getting loaded. When I put break points in the modules, they get hit and return. The majority of modules return constructor functions, however when the ChartingApp define callback runs, all the modules in the callback are just base Objects with no parameters.

I was previously using requirejs to load these modules and everything worked. What might I be missing here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions