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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...