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

TypeError: undefined is not an object (evaluating 'pixiTextureByName.polygons.scale') #39

Open
congratulatio opened this issue Oct 12, 2020 · 0 comments

Comments

@congratulatio
Copy link
Member

This error was reported to the /clienterror endpoint:

origin: https://airmash.online
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
error:
  message: undefined is not an object (evaluating 's.polygons.scale')
  line: 1
  column: 643149
  sourceURL: https://airmash.online/assets/engine.js?e2feade811be4b83072a&_sm_byp=iVVRJHRr9MQt6r07
  stack:
    v@https://airmash.online/assets/engine.js?e2feade811be4b83072a&_sm_byp=iVVRJHRr9MQt6r07:1:643149
    https://airmash.online/assets/engine.js?e2feade811be4b83072a&_sm_byp=iVVRJHRr9MQt6r07:1:640858
    https://airmash.online/assets/engine.js?e2feade811be4b83072a&_sm_byp=iVVRJHRr9MQt6r07:1:741207

The polygons property was missing from pixiTextureByName at this point:

var initPolygonsScale = function() {
pixiTextureByName.polygons.scale.x = game.scale,
pixiTextureByName.polygons.scale.y = game.scale
};

The call stack above indicates this function was called from resizeRenderer:

initPolygonsScale(),

Likely root cause is that assets/map.json had not been fetched yet (or at all) at that point:

var createMapFromJson = function() {
$.getJSON("assets/map.json", function(mapResponse) {
pixiTextureByName.polygons = new PIXI.Graphics,

@congratulatio congratulatio changed the title TypeError: undefined is not an object (evaluating 's.polygons.scale') TypeError: undefined is not an object (evaluating 'pixiTextureByName.polygons.scale') Oct 12, 2020
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

1 participant