Getting an error when trying to run grunt build

240 views
Skip to first unread message

Mayank Pandey

unread,
Feb 25, 2021, 9:38:54 AM2/25/21
to Developing Interactive Simulations in HTML5
Hello!

I was recently trying to use grunt build task but I get the following error:

Fatal error: Perennial task failed:
Error: git rev-parse HEAD in ../acceleration-lab failed with exit code 128 and stdout:

  at ChildProcess.<anonymous> (/Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/execute.js:77:17)
  at ChildProcess.emit (events.js:315:20)
  at maybeClose (internal/child_process.js:1048:16)
  at Socket.<anonymous> (internal/child_process.js:439:11)
  at Socket.emit (events.js:315:20)
  at Pipe.<anonymous> (net.js:673:12)

Full Error details:
Error: git rev-parse HEAD in ../acceleration-lab failed with exit code 128 and stdout:
HEAD

what am I doing wrong?

Thank you for your time!

Regards,
Mayank Pandey.

Chris Malley

unread,
Feb 26, 2021, 11:17:41 AM2/26/21
to Developing Interactive Simulations in HTML5
Hi Mayank,

I'm seeing the same problem.  
I have opened a high-priority bug report, see https://github.com/phetsims/chipper/issues/1011.
Someone will reply here when the problem is fixed.
Sorry for the inconvenience.

Chris Malley
PixelZoom, Inc.

Jonathan Olson

unread,
Feb 26, 2021, 11:48:27 AM2/26/21
to Developing Interactive Simulations in HTML5
Hello!

I believe I've fixed this with https://github.com/phetsims/chipper/commit/24c2f7ab261cf46e19dfda8abed580ce40cdf0e0. Can you go to the chipper repo, `git pull`, and try again?

Sorry about the problem!

-Jonathan Olson

Mayank Pandey

unread,
Feb 26, 2021, 8:33:38 PM2/26/21
to Developing Interactive Simulations in HTML5
Hello!

I appreciate the help but now I am facing a new error, I hate you disturb you guys but what is wrong here?

Running "build" task
Building runnable repository (Numerical-Differentiation, brands: adapted-from-phet)
Building brand: adapted-from-phet
>> Webpack build complete: 4529ms
Did not find git information for Numerical-Differentiation
>> WARNING404: Skipping potentially non-public dependency phet-io
>> WARNING404: Skipping potentially non-public dependency phet-io-client-guides
>> WARNING404: Skipping potentially non-public dependency phet-io-wrappers
>> WARNING404: Skipping potentially non-public dependency studio
Fatal error: Perennial task failed:
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Missing string information for numerical-differentiation custom
  at /Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/getStringMap.js:213:9
  at Array.forEach (<anonymous>:null:null)
  at /Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/getStringMap.js:202:15
  at Array.forEach (<anonymous>:null:null)
  at /Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/getStringMap.js:201:23
  at Array.forEach (<anonymous>:null:null)
  at module.exports (/Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/getStringMap.js:153:24)
  at module.exports (/Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/buildRunnable.js:132:21)
  at /Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/Gruntfile.js:254:11
  at wrap (/Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/Gruntfile.js:73:7)

Full Error details:
AssertionError [ERR_ASSERTION]: Missing string information for numerical-differentiation custom

Message has been deleted

cmalley

unread,
Feb 27, 2021, 10:50:40 AM2/27/21
to Developing Interactive Simulations in HTML5
You can ignore this, it just means that your repository is not checked into GitHub, but the build should still work:

> Did not find git information for Numerical-Differentiation

You can ignore these warnings. They are for building dependencies related to PhET's commerical product called "PhET-iO".  The build should still succeed.

>> WARNING404: Skipping potentially non-public dependency phet-io
>> WARNING404: Skipping potentially non-public dependency phet-io-client-guides
>> WARNING404: Skipping potentially non-public dependency phet-io-wrappers
>> WARNING404: Skipping potentially non-public dependency studio

This is where the problem appears to be:

> Fatal error: Perennial task failed:
> AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Missing string information for numerical-differentiation custom

I know it's not obvious from the error message, but this means that it's looking for a translated string with key "custom" in string string file numerical-differentiation_en.json.   

I suspect that you named your repo Numerical-Differentiation (uppercase), in which case the string file should be Numerical-Differentiation_en.json.  The error message is for some reason incorrect, and refers to numerical-differentiation (lowercase). I'll create a bug report to fix that.  In any case, I highly recommend that you use lowercase for your repository name.

So...  The problem is likely that you have added a new translated string to your JavaScript code, something like  NumericalDifferentiationStrings.custom.  If so, you need to add an entry for that string in Numerical-Differentiation_en.json, something like this:

"custom": {
"value": "Custom" 
}

Let me know if this resolves the problem.

Chris Malley
PixelZoom, Inc.

Mayank Pandey

unread,
Feb 27, 2021, 12:42:28 PM2/27/21
to Developing Interactive Simulations in HTML5
Hello!

Thank you for the reply, I was able to fix that problem with your help but now a new problem has come through. I am so sorry I am new to this and it's hard to debug this

Running "build" task
Building runnable repository (Numerical-Differentiation, brands: adapted-from-phet)
Building brand: adapted-from-phet
>> Webpack build complete: 4888ms
Did not find git information for Numerical-Differentiation
>> WARNING404: Skipping potentially non-public dependency phet-io
>> WARNING404: Skipping potentially non-public dependency phet-io-client-guides
>> WARNING404: Skipping potentially non-public dependency phet-io-wrappers
>> WARNING404: Skipping potentially non-public dependency studio
>> Unused string: key=NUMERICAL_DIFFERENTIATION/Numerical-Differentiation.title, value=numerical
>> Unused string: key=Numerical-Differentiation.title, value=numerical
Fatal error: Perennial task failed:
AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: missing entry for sim title, key = NUMERICAL_DIFFERENTIATION/Numerical-Differentiation.title
  at module.exports (/Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/buildRunnable.js:146:3)
  at /Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/Gruntfile.js:254:11
  at wrap (/Users/mayankpandey/Desktop/phetsims/chipper/js/grunt/Gruntfile.js:73:7)

Full Error details:
AssertionError [ERR_ASSERTION]: missing entry for sim title, key = NUMERICAL_DIFFERENTIATION/Numerical-Differentiation.title

This is the error I get now and as you can see in these lines

>> Unused string: key=NUMERICAL_DIFFERENTIATION/Numerical-Differentiation.title, value=numerical
>> Unused string: key=Numerical-Differentiation.title, value=numerical

I tried giving it the key and value but it's still not working

Mayank Pandey

unread,
Mar 6, 2021, 8:08:47 AM3/6/21
to Developing Interactive Simulations in HTML5
Can anyone help me with this?

cmalley

unread,
Mar 7, 2021, 11:36:18 AM3/7/21
to Developing Interactive Simulations in HTML5
It's another case of the same problem that you had previously. As the error message says, you are missing a translated string: 

> key = NUMERICAL_DIFFERENTIATION/Numerical-Differentiation.title

Add this to Numerical-Differentiation-strings_en.json, the English translatable strings:

"Numerical-Differentiation.title": {
"value": "Numerical Differentiation" 
}


Any translated string that you add to .js code needs to be added to this file.

Chris Malley
PixelZoom, Inc.

Mayank Pandey

unread,
Mar 7, 2021, 3:28:36 PM3/7/21
to Developing Interactive Simulations in HTML5
Hello!

Thank you for replying but that did not fix the issue, is there something else I can do?

I also noticed that the earlier error message and this one are different:

Old error:
> Fatal error: Perennial task failed:
> AssertionError [ERR_ASSERTION] [ERR_ASSERTION]: Missing string information for numerical-differentiation custom

New Error:
Full Error details:
AssertionError [ERR_ASSERTION]: missing entry for sim title, key = NUMERICAL_DIFFERENTIATION/Numerical-Differentiation.title


cmalley

unread,
Mar 8, 2021, 11:32:25 AM3/8/21
to Developing Interactive Simulations in HTML5
The error message is different because the missing string is needed by part of PhET simulation framework that is responsible for the simulation's title.  All simulations are required to have a title.  And that should have been handled automatically if you used 'grunt create-sim' to create your Numerical-Differentiation simulation.

In order to debug, please provide the following information:

(1) How did you create Numerical-Differentiation? Did you use 'grunt create-sim', as specified in the "PhET Development Overview"?    If you used 'grunt create-sim', please provide the complete command that you used.

(2) Please provide Numerical-Differentiation/js/Numerical-Differentiation-main.js

(3) Please provide Numerical-Differentiation/Numerical-Differentiation-strings.json

Chris Malley
PixelZoom, Inc.

cmalley

unread,
Mar 8, 2021, 11:52:28 AM3/8/21
to Developing Interactive Simulations in HTML5
I tested things myself, and I see no problems.  My guess is that you are either not using grunt create-sim, or you edited (and broke) something related to the title string.

(1) I created  the sim using this command:

% cd perennial
% grunt create-sim --repo=Numerical-Differentiation --author="CM"

Then I immedidate tested it, and it builds fine:

% cd ../Numerical-Differentiation
% grunt build --brands=adapted-from-phet
Running "build" task
Building runnable repository (Numerical-Differentiation, brands: adapted-from-phet)
Building brand: adapted-from-phet
>> Webpack build complete: 1706ms
Did not find git information for Numerical-Differentiation
>> Production minification complete: 11508ms (1231033 bytes)
>> Debug minification complete: 0ms (4959446 bytes)

Done.

%


(2) Numerical-Differentiation-main.js is generated with code to access the title string. This is the relevant line:

const numericalDifferentiationTitleString = numericalDifferentiationStrings[ 'Numerical-Differentiation' ].title;

(3) Numerical-Differentiation-strings_en.json is generated a default title string. This is the complete contents of the file:

{
  "Numerical-Differentiation.title": {
    "value": "Numerical Differentiation"
  }
}

Chris Malley
PixelZoom, Inc.
Message has been deleted

Mayank Pandey

unread,
Mar 8, 2021, 11:57:44 AM3/8/21
to Developing Interactive Simulations in HTML5
Hello!

Apparently I am an idiot haha, so were completely right, the issue was in the Numerical-Differentiation-main.js. I was not referencing the correct string from Numerical-Differentiation-strings.json. I probably broke something while making some changes to the credits, my bad. I really appreciate the help!

Thank you for your time!

Reply all
Reply to author
Forward
Message has been deleted
0 new messages