I am working on an EOS dApp that is listing dogs (it could be other items) and displaying them on an HTML page. The dApp has a function in its JS file to add dogs.
This dApp is working with nodeos up and running, a Python server up and running, and Scatter.
In my HTML page, although I can see some elements such as the textbox and the button to add dogs, the list of dogs is not diplayed. It should come inside my <ul id="doglist"></>
Instead, I am getting an error in my console:
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
asyncToGenerator.js:6
My asyncToGenerator.js file reads as follows:
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
module.exports = _asyncToGenerator;
It seems the reject(error);
line in the first function is causing an issue.
If you need to see my main.js
file that is part of my front end, I can post it here.
Thank you for your assistance!