Error in the character generator app

Hello,
When I try to generate a whitestar character, the generator fails at the envirnment step. Basically the page onlly shows the logo and background.
In the developer tools of MS Edge I get the following errors:

  1. uncaught type error: cannot read property 0 of undefined in “new t” at line 15 of MC.js
  2. Uncaught invariant violation: Minified React error at line 1 of mc.js
  3. Uncaught type error: cannot read property getHostNode of null in mc.js line 1

Can anyone at Modiphius solve it?

EDIT:
The first error is here:
function(e) {
function t(t) {
var a = e.call(this, t) || this;
(a._regions = c.EnvironmentsHelper.getRegions(o.character.heritage, o.character.environment),
a._region = a._regions[0],
o.character.hasSource(g.Source.Imperial) || o.character.faction === w.Faction.Imperial) || c.EnvironmentsHelper.getEnvironment(o.character.environment).equipment.forEach(function(e) {
e.indexOf("|") > -1 && (a._equipment = e.split("|")[0])
});
return a
}

The second one is here:
function(e, t, a) {
“use strict”;
e.exports = function(e) {
for (var t = arguments.length - 1, a = “Minified React error #” + e + “; visit http://facebook.github.io/react/docs/error-decoder.html?invariant=” + e, n = 0; n < t; n++)
a += “&args[]=” + encodeURIComponent(arguments[n + 1]);
a += " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
var r = new Error(a);
throw r.name = “Invariant Violation”,
r.framesToPop = 1,
r
}
}

The last one is here:
getHostNode: function(e) {
return e.getHostNode()
},

PS:
Who writes all the functions together in a single array? Wouldn’t it be better to split the mc.js into multiple files instead of having a single file of almost 33000 lines of code?

5 Likes

As far as I know, all the character generators for 2d20 games were programmed by a single developer, who is no longer available to fix anything or maintain them regarding new contents or new features.

@ingframin You seem to be quite knowledgeable in the underlying programming and you have ideas how to improve that.
Could you be persuaded to take over the maintenance and maybe refactoring of the generator code?

4 Likes

Well, I am no Javascript expert to be honest. I can work on the tool if no other person is willing to do it but it’s going to be in my spare time.
It would be nice to have Modiphius blessing though, I don’t really want to touch copyrighted material without permission.
I can put something together, a prototype to test my ideas. If then I get a formal approval I can continue to work on it.
As for the other games, it is complicated for me because I don’t have the manuals an do not even know all the bells an whistles.

4 Likes

Well the code is on github and Christoffer said it was ok for anyone to take over, so it should be very ok for you to take over :slight_smile:
Last time I touched javascript was 20 years ago and my spare time is a rare ressource, so I’ll be only able to pray for the Cardinal to give you some strength unfortunately.

4 Likes

Please fix it! :grin:

3 Likes

I’ll try to fix it then but I need some time to work on it. I keep you posted on the progress

8 Likes