epugh opened a new pull request, #5248:
URL: https://github.com/apache/solr/pull/5248

   ## Summary
   - `solr/webapp/js-client`'s `jsClientDownloadDeps` Gradle task ran plain 
`npm install`, which npm treats as `--production` whenever the caller's 
environment has `NODE_ENV=production` set - silently skipping `devDependencies`.
   - That breaks the build: the package's own `prepare` lifecycle script (`npm 
run build`, i.e. Babel) needs those devDependencies (`@babel/core`, presets, 
plugins like `@babel/plugin-syntax-dynamic-import`) to run.
   - This bit RC3 smoke testing specifically because 
`dev-tools/scripts/smokeTestRelease.py` does `env.update(os.environ)` when 
shelling out, inheriting whatever ambient `NODE_ENV` the release manager's 
shell happened to have set.
   - Fix: `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 its `node_modules`/`package.json` are 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
   - Reproduced the failure standalone: copied the generated workspace to a 
scratch dir, ran `NODE_ENV=production npm install` - fails with 
`ERR_MODULE_NOT_FOUND` on `@babel/plugin-syntax-dynamic-import` during the 
`prepare` script's Babel build, confirming the root cause.
   - Confirmed `NODE_ENV=production npm install --include=dev` fixes it in that 
same scratch dir.
   - Confirmed the real Gradle task, `:solr:webapp:js-client:jsClientBuild`, 
succeeds from a clean `node_modules` both with and without 
`NODE_ENV=production` set after this change.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to