Wrong module in vendor.js


#1

Hello everyone!

I an developing to different ionic apps at the moment (different directories, different node_modules directories of course). In the first app, I have some difficulties with plotly.js (see my post here: https://github.com/plotly/plotly.js/issues/2599 ). The problem is: the second app doesn’t use plotly at all and still it has the same problem. I checked twice in this second app for any plotly references in my source or node_modules, there are none. But when I run ionic serve this Error occurs:

Uncaught TypeError: Cannot read property ‘format’ of undefined

And it points to the file

http://http://localhost:8100/build/vendor.js

In this file I found:

/**
* Copyright 2012-2018, Plotly, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/




var d3 = __webpack_require__(4);
var isNumeric = __webpack_require__(9);

var Loggers = __webpack_require__(141);
var mod = __webpack_require__(275);

var constants = __webpack_require__(13);
var BADNUM = constants.BADNUM;
var ONEDAY = constants.ONEDAY;
var ONEHOUR = constants.ONEHOUR;
var ONEMIN = constants.ONEMIN;
var ONESEC = constants.ONESEC;
var EPOCHJD = constants.EPOCHJD;

var Registry = __webpack_require__(3);

var utcFormat = d3.time.format.utc;

This is clearly code from plotly.js and I cannot explain why it is there. There is no plotly in this app. The Error is in the last line of the code example.

Can someone help me to further explore where this code is comming from and how I can get rid of it?
Help with the plotly.js problem mentioned in the link above is also appreciated.


#2

Any references to ‘plotly’ in your package.json ?


#3

No, there are no References.

The Error occurred because Chrome was lazy and the vendor.js was not built acutally built every time but loaded from cache. So if I run the first app and then the second app, the vendor.js is still the one from the first app. Thats the reason why plotly is in it.

Fixed it by using Ctrl + Shift + F5 in developer mode to empty the cache.


#4

Another thing you can do is disable the cache when the dev tools are open. In devtools click the “more” dropdown button, and go into settings. Then scroll down to the Network section and there you’ll see a toggle for “Disable cache (while DevTools is open)”.