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!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...