Repository navigation
fix(deps): bump execjs to 2.10.2; add assets precompile CI job - #3055
Merged
Merged
Conversation
execjs 2.10.1 calls JSON.parse(output, create_additions: false), and json 3.1.0 removed the create_additions keyword, so rake assets:precompile aborts with ArgumentError: unknown keyword: create_additions whenever the Terser compressor runs. Dependabot PR #3051 bumped json to 3.1.0 and deploys have been rejected since. execjs 2.10.2 (released 2026-08-12) drops the keyword. Verified locally: ExecJS.compile raises with execjs 2.10.1 and succeeds with 2.10.2, and rake assets:precompile completes with json 3.1.0 installed.
mroderick
force-pushed
the
fix/execjs-2-10-2-and-precompile-ci
branch
from
October 24, 2026 06:09
1a2401e to
3aa58b1
Compare
The test suite never runs the Terser compressor, so the execjs/json incompatibility passed CI while rejecting every Heroku deploy. The new job runs rake assets:precompile in RAILS_ENV=production. It boots the app without touching a database, so a placeholder DATABASE_URL is enough, and PLANNER_SECRET satisfies config/initializers/ secret_token.rb.
mroderick
force-pushed
the
fix/execjs-2-10-2-and-precompile-ci
branch
from
October 24, 2026 06:13
3aa58b1 to
ae088c5
Compare
mroderick
marked this pull request as ready for review
October 24, 2026 06:24
mroderick
enabled auto-merge
October 24, 2026 06:27
mroderick
disabled auto-merge
October 24, 2026 06:27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Deploys to Heroku have been rejected since PR #3051 (json 2.21.2 → 3.1.0): rake assets:precompile aborts with
ArgumentError: unknown keyword: create_additions. This PR bumps execjs to 2.10.2, which fixes it, and adds a CI job that runs the asset precompile so this class of breakage fails in CI instead of at deploy time.Key changes
create_additions: falsetoJSON.parse, a keyword json 3.x removed; 2.10.2 (released 2026-08-12) callsJSON.parse(output)without it. Terser's constraint (>= 0.3.0, < 3) already allows the new version, so no Gemfile change is needed.Assets Precompilejob in.github/workflows/ruby.yml:rake assets:precompileunderRAILS_ENV=production. The task boots the app without connecting to a database, so a placeholderDATABASE_URLresolves the adapter, andPLANNER_SECRET(the app's own secret, set inconfig/initializers/secret_token.rb) plus AWS credentials (AWS_ACCESS_KEY,AWS_SECRET_ACCESS_KEY, read byconfig/initializers/carrier_wave.rb) stand in for the real values; nothing connects to S3 during precompile.Detail
The failure path:
rake assets:precompile→ Sprockets → Terser 1.2.8 → ExecJS 2.10.1ExecJS::ExternalRuntime::Context#extract_result, which called::JSON.parse(output, create_additions: false)(external_runtime.rb:69). json 3.1.0 removed thecreate_additionskeyword fromJSON.parse(flagged as a TODO in json 2.21.2: "extract :create_additions support to another gem for version 3.0"), so every production build died while minifying the first JS asset. The build log confirmed the bundler cache swap of json 2.21.2 for 3.1.0 in the same run.Why CI missed it: the workflow runs RuboCop, parallel RSpec (uncompressed assets, RAILS_ENV=test), and bundler-audit — nothing loads ExecJS or Terser. The only caller of ExecJS is the Terser compressor wired in
config/environments/production.rb.Verified locally with json 3.1.0 installed:
ExecJS.compile("1+1")raises the ArgumentError under execjs 2.10.1 and succeeds under 2.10.2;RAILS_ENV=production PLANNER_SECRET=fake DATABASE_URL=postgres://u:p@localhost:5432/planner_placeholder bundle exec rake assets:precompilecompletes.Review notes
No special focus requested; the diff is lockfile plus one CI job. Deliberately not done: no Node version pinning (the Heroku warning about the default Node.js version is pre-existing), and no removal of the
bin/bundlebinstub (also pre-existing, unrelated).