How to fix module exports not defined in javascript

1.9k Views Asked by At
module.exports = {
        LogValue1: function (data)
        {
            return somevalue;
        },
};

var fetch = require('./static/fetchData'); 
fetch.LogValue1(data);
1

There are 1 best solutions below

1
GarbageCollector On

If the problem is the require part, you need to you requireJs for that.

Just add to your page.

http://requirejs.org/