Library: Library repo that im using
I just don't think I am getting the point of requirejs that leads me to be incapable of loading in StackTrace from the stacktrace js library.
I have stacktrace-with-promises-and-json-polyfills.min.js
saved under js/lib/stacktrace.js
(I renamed it for a shorter version).
In my config, I tried to add:
requirejs.config({
paths: {
"stacktrace": "js/lib/stacktrace"
}
});
Which did not work so I removed them, yet I am able to grab the library from another js module thru:
define(['lib/stacktrace'], function(StackTrace) {
// function is on page load
function onPageLoad() {
console.log(StackTrace);
StackTrace.get().then(/* defined callback */).catch(/*defined */);
}
}
Which is really strange to me that it prints out this with error:
I can log the object but all the functions are lost. I have tried with the original stacktrace.min.js
too. Sometimes StackTrace
is undefined.
Looking back, I have no idea on how to write a requirejs config to allow stacktrace js library to become a module. Please help.