Errors - no-unused-vars & no-undefs though defined const is used.

19 views
Skip to first unread message

25. Sai Surya

unread,
Apr 23, 2022, 3:08:33 AM4/23/22
to Developing Interactive Simulations in HTML5
Hi All,

I get below error when I run 'grant' from my simulation root directory.

 37:11  error  'footballControlsTitleNode' is assigned a value but never used  no-unused-vars
  62:9   error  'footBallControlsTitleNode' is not defined                      no-undef

However, I actually do have const defined and indeed using it in same file. Below is code.

// 'Football Controls' title
    const footballControlsTitleNode = new Text( gravitySimStrings.footballControls, {
      font: new PhetFont( {
        size: 18,
        weight: 'bold'
      } )
    } );

// The contents of the control panel
    const content = new VBox( {
      align: 'center',
      spacing: 10,
      children: [
        footBallControlsTitleNode,
        pushButton
      ]
    } );

Any clue is much appreciated.

Thanks & Regards,
Sai Surya

samrreid

unread,
Apr 26, 2022, 12:43:05 PM4/26/22
to Developing Interactive Simulations in HTML5
Please be aware the JavaScript language is case-sensitive so footBall and football are not interchangeable.  Have a great day!

Sam

25. Sai Surya

unread,
Apr 27, 2022, 9:11:59 AM4/27/22
to Developing Interactive Simulations in HTML5
Of course, my bad! Thanks for the hint Sam.
Reply all
Reply to author
Forward
0 new messages