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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...