Repository navigation
SOLR-18593: Install JS client devDependencies regardless of NODE_ENV - #5248
Merged
Merged
Conversation
solr/webapp/js-client's npm install previously ran as plain `npm install`, which npm interprets as --production whenever NODE_ENV=production is set in the caller's environment - skipping devDependencies. That breaks the build, since the package's own "prepare" script (npm run build, i.e. babel) needs devDependencies (@babel/core, presets, plugins) to run. This bit RC3 smoke testing, where smokeTestRelease.py's subprocess inherited the release manager's ambient NODE_ENV=production. This workspace is purely a build-time code generator (Gradle syncs the OpenAPI-generated sources in, babel transpiles them, browserify bundles the result into one file for the webapp) - none of its node_modules/package.json get published, so there's no "production" artifact here to keep lean by omitting dev tooling. --include=dev makes the install correct regardless of the caller's ambient environment. Verified empirically: reproduced the failure in a scratch copy of the generated workspace with NODE_ENV=production npm install (ERR_MODULE_NOT_FOUND on @babel/plugin-syntax-dynamic-import), confirmed --include=dev fixes it there, and confirmed the Gradle jsClientBuild task succeeds both with and without NODE_ENV=production set after this change.
janhoy
reviewed
Oct 28, 2026
| The generated JS client's build (solr/webapp/js-client) now installs with --include=dev, so it no | ||
| longer fails when the builder's environment has NODE_ENV=production set - npm would otherwise | ||
| skip the devDependencies (Babel and its plugins) that the build's own "prepare" script needs. | ||
| type: fixed |
Contributor
There was a problem hiding this comment.
Maybe user "other" for non-product fixes?
janhoy
approved these changes
Oct 28, 2026
janhoy
left a comment
Contributor
There was a problem hiding this comment.
LGTM, one nit with changelog type
Contributor
Author
|
I was struggling with "is this worth it", but going to take your vote as a +1... will make change. |
Contributor
Author
|
Thanks @nick-boss-tech for putting this change together! |
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
solr/webapp/js-client'sjsClientDownloadDepsGradle task ran plainnpm install, which npm treats as--productionwhenever the caller's environment hasNODE_ENV=productionset - silently skippingdevDependencies.preparelifecycle script (npm run build, i.e. Babel) needs those devDependencies (@babel/core, presets, plugins like@babel/plugin-syntax-dynamic-import) to run.dev-tools/scripts/smokeTestRelease.pydoesenv.update(os.environ)when shelling out, inheriting whatever ambientNODE_ENVthe release manager's shell happened to have set.args.set(listOf("install", "--include=dev")). This workspace is purely a build-time code generator (Gradle syncs the OpenAPI-generated sources in, Babel transpiles, browserify bundles the result into one file for the webapp) - none of itsnode_modules/package.jsonare ever published, so there's no actual "production" artifact here to keep lean by omitting dev tooling. Installing dev deps unconditionally makes the build correct independent of the caller's ambient environment.Verification
NODE_ENV=production npm install- fails withERR_MODULE_NOT_FOUNDon@babel/plugin-syntax-dynamic-importduring thepreparescript's Babel build, confirming the root cause.NODE_ENV=production npm install --include=devfixes it in that same scratch dir.:solr:webapp:js-client:jsClientBuild, succeeds from a cleannode_modulesboth with and withoutNODE_ENV=productionset after this change.🤖 Generated with Claude Code