Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stand Alone (sans NodeJS) Does Not Work #1

Open
ctessler opened this issue Aug 23, 2018 · 1 comment
Open

Stand Alone (sans NodeJS) Does Not Work #1

ctessler opened this issue Aug 23, 2018 · 1 comment

Comments

@ctessler
Copy link

Apologies, I'm a JavaScript newbie but I have a couple of problems. These could be solved by code fixes or more detailed installation instructions when outside of a NodeJS environment. I'll describe my usage, fixes, and the error that caused me to get stuck.

Usage: file.xhtml

<script ... src="dist/smashgg-promise.js"></script> <script ... scr="smashgg-user.js"></script>

smashgg-user.js makes use of the smashgg-promise objects and API.

Problem 1:
Lines 912-915 cause inclusion problems, commenting them out solves this issue.
Uncaught ReferenceError: Match is not defined at smashgg-promise.js:912
After commenting out 912 and 913
Uncaught ReferenceError: module is not defined at smashgg-promise.js:915
Resolution comment out 912-915

Problem 2:
From the following code snippet:

var promise = smashgg.getTournament(TOURNAMENT_SLUG);
	promise.then(function(t) {
		console.log(t);
		var promise2 = t.getAllMatches();
		promise2.then(function (m) { // Error here
			m.forEach(function (match) {
				console.log(match);
			});
		});
	});

The call to then on promise2 results in an uncaught error.

Uncaught (in promise) Error: Winner Player for Set cannot be null, and must be an instance of ggPlayer
    at new Set (smashgg-promise.js:694)
    at ThisPhaseGroup.findPlayersByIds.then.players (smashgg-promise.js:612)
Set @ smashgg-promise.js:694
ThisPhaseGroup.findPlayersByIds.then.players @ smashgg-promise.js:612
Promise.then (async)
(anonymous) @ smash-p1-record.js:79
Promise.then (async)
update_results @ smash-p1-record.js:76
reload_complete @ smash-p1-record.js:43
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
k @ jquery-3.3.1.min.js:2
(anonymous) @ jquery-3.3.1.min.js:2
load (async)
send @ jquery-3.3.1.min.js:2
ajax @ jquery-3.3.1.min.js:2
w.(anonymous function) @ jquery-3.3.1.min.js:2
getJSON @ jquery-3.3.1.min.js:2
reload @ smash-p1-record.js:24
main @ smash-p1-record.js:18
l @ jquery-3.3.1.min.js:2
c @ jquery-3.3.1.min.js:2
setTimeout (async)
(anonymous) @ jquery-3.3.1.min.js:2
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
fire @ jquery-3.3.1.min.js:2
u @ jquery-3.3.1.min.js:2
fireWith @ jquery-3.3.1.min.js:2
ready @ jquery-3.3.1.min.js:2
_ @ jquery-3.3.1.min.js:2

It is here where I get stuck and cannot proceed. Could you please help?

@BrandonCookeDev
Copy link
Owner

I apologize for missing this issue.
Is this still ongoing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants