From ef1729357d4da98e295a393c0679280452aff7ea Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Tue, 27 Oct 2026 11:12:43 -0400 Subject: [PATCH 1/3] SOLR-18593: Install JS client devDependencies regardless of NODE_ENV 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. --- .../unreleased/SOLR-18593-js-client-prod-install.yml | 12 ++++++++++++ solr/webapp/js-client/build.gradle.kts | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/SOLR-18593-js-client-prod-install.yml diff --git a/changelog/unreleased/SOLR-18593-js-client-prod-install.yml b/changelog/unreleased/SOLR-18593-js-client-prod-install.yml new file mode 100644 index 000000000000..e840a70185a6 --- /dev/null +++ b/changelog/unreleased/SOLR-18593-js-client-prod-install.yml @@ -0,0 +1,12 @@ +# See https://github.com/apache/solr/blob/main/dev-docs/changelog.adoc +title: + 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 +authors: + - name: Eric Pugh + nick: epugh +links: + - name: SOLR-18593 + url: https://issues.apache.org/jira/browse/SOLR-18593 diff --git a/solr/webapp/js-client/build.gradle.kts b/solr/webapp/js-client/build.gradle.kts index 1ce43c25978b..3772dcbef4ed 100644 --- a/solr/webapp/js-client/build.gradle.kts +++ b/solr/webapp/js-client/build.gradle.kts @@ -58,7 +58,12 @@ val syncJSClientSourceCode = tasks.register("syncJSClientSourceCode") { val jsClientDownloadDeps = tasks.register("jsClientDownloadDeps") { dependsOn(syncJSClientSourceCode) - args.set(listOf("install")) + // The 'prepare' lifecycle script (npm run build, i.e. babel) needs the devDependencies + // (@babel/core, presets, plugins) to run. --include=dev installs them regardless of a + // NODE_ENV=production in the caller's environment, which would otherwise make npm skip them + // and break this build - this workspace is purely a build-time code generator, not a published + // package, so there's no "production" artifact here to keep lean by omitting dev tooling. + args.set(listOf("install", "--include=dev")) workingDir.set(jsClientWorkspace) inputs.dir("$jsClientWorkspace/src") From abfc2ece19632c883b85cae6dbe3ccd2addfaed8 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Wed, 28 Oct 2026 17:15:51 -0400 Subject: [PATCH 2/3] Improve changelog --- changelog/unreleased/SOLR-18593-js-client-prod-install.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog/unreleased/SOLR-18593-js-client-prod-install.yml b/changelog/unreleased/SOLR-18593-js-client-prod-install.yml index e840a70185a6..fc8b5f03e7d3 100644 --- a/changelog/unreleased/SOLR-18593-js-client-prod-install.yml +++ b/changelog/unreleased/SOLR-18593-js-client-prod-install.yml @@ -3,10 +3,12 @@ title: 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 +type: other authors: - name: Eric Pugh nick: epugh + - name: Nick Shanin + nick: nick-boss-tech links: - name: SOLR-18593 url: https://issues.apache.org/jira/browse/SOLR-18593 From 2608683340130c4d01b3ec5edef198e458a3c858 Mon Sep 17 00:00:00 2001 From: Eric Pugh Date: Wed, 28 Oct 2026 17:22:21 -0400 Subject: [PATCH 3/3] simplify comments --- solr/webapp/js-client/build.gradle.kts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/solr/webapp/js-client/build.gradle.kts b/solr/webapp/js-client/build.gradle.kts index 3772dcbef4ed..5f57d4170035 100644 --- a/solr/webapp/js-client/build.gradle.kts +++ b/solr/webapp/js-client/build.gradle.kts @@ -58,11 +58,8 @@ val syncJSClientSourceCode = tasks.register("syncJSClientSourceCode") { val jsClientDownloadDeps = tasks.register("jsClientDownloadDeps") { dependsOn(syncJSClientSourceCode) - // The 'prepare' lifecycle script (npm run build, i.e. babel) needs the devDependencies - // (@babel/core, presets, plugins) to run. --include=dev installs them regardless of a - // NODE_ENV=production in the caller's environment, which would otherwise make npm skip them - // and break this build - this workspace is purely a build-time code generator, not a published - // package, so there's no "production" artifact here to keep lean by omitting dev tooling. + // Need to install devDependencies like Babel to support the build-time code generator, + // even though no actual dev tooling ships in Solr args.set(listOf("install", "--include=dev")) workingDir.set(jsClientWorkspace)