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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...