Getting Data In

Javascript SDK ASync is unusable

terryloar
Path Finder

I am loading all of the js files that the Javascript SDK needs, but it declares 'exports' and 'require' undefined. There is no other code involved, it gives the error upon loading the *.js files.

Are there any other files that must be loaded?

From the Console Log:

exports is not defined
var root = exports || this;

async.js (line 20)
exports is not defined

var root = exports || this;
utils.js (line 19)
require is not defined

var Service = require('./service');
storm.js (line 19)
require is not defined

var Context = require('./context');
service.js (line 19)
require is not defined

var Service = require('./service');
searcher.js (line 19)
exports is not defined

var root = exports || this;
paths.js (line 19)
require is not defined

var Class = require('./jquery.class').Class;
http.js (line 19)
require is not defined

var Paths = require('./paths').Paths;
context.js (line 19)
Async is not defined

ineeman
Splunk Employee
Splunk Employee

You only need to include the splunk.js file from the client directory. It is built from the the other files. You can read notes about this on dev.splunk.com:

http://dev.splunk.com/view/SP-CAAAEFN

0 Karma

ineeman
Splunk Employee
Splunk Employee

Can you show the entire contents of your page (you can paste it at gist.github.com or some other pastebin), so we can see what the issue is?

0 Karma

terryloar
Path Finder

I tried that but it still throws errors:

====
Async is not defined

Async.chain([

====

container is undefined

if(!container.appendChild || !container.cloneNode) {

splunk.ui.charting.js (Line 932)

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...