phetsims / perennial

Maintenance tools that won't change with different versions of chipper checked out
MIT License
3 stars 5 forks source link

Build Failure: Cannot read properties of undefined (reading 'end') #296

Open mattpen opened 1 year ago

mattpen commented 1 year ago

The build-server is failing for build-a-nucleus while it is parsing screen names:

info: puppeteer pageerror: Error: TypeError: Cannot read properties of undefined (reading 'end')
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at u (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:882:52263)
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at u (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:882:53414)
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at e.default (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:882:50932)
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at e.parse (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:882:12963)
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at xc.rebuildRichText (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:894:863871)
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at xc.onTextPropertyChange (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:894:8>
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at Ns.emit (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:894:14727)
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at Ns.notifyListeners (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:894:16251)
Dec 17 16:53:46 phet-server2.int.colorado.edu build-server[1823055]:     at Ns.set (https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA:894:15988)

This can be reproduced with this snippet:

const puppeteerLoad = require( '../common/puppeteerLoad.js' );
const puppeteer = require( 'puppeteer' );

const browser = await puppeteer.launch();
const url = `https://phet.colorado.edu/sims/html/build-a-nucleus/latest/build-a-nucleus_all.html?locale=ar_MA`;
const result = await puppeteerLoad( url, {
  waitForFunction: 'phet.joist.sim.screens',
  browser: browser,
  evaluate: () => {
    return phet.joist.sim.screens
      .map( screen => screen.name || ( screen.nameProperty && screen.nameProperty.value ) )
      .filter( ( screenName, screenIndex ) => !( screenIndex === 0 && screenName === '\u202aHome\u202c' ) );
  }
} );
console.log(result);

@zepumph and I both looked for usages of .end in the project and couldn't initially find anything related to puppeteerLoad or parseScreenNames.