Skip to content

docs: troubleshoot stale .nodeenv blocking local tox/install#405

Open
mmcky wants to merge 1 commit into
mainfrom
maint/dev-env-nodeenv-troubleshooting
Open

docs: troubleshoot stale .nodeenv blocking local tox/install#405
mmcky wants to merge 1 commit into
mainfrom
maint/dev-env-nodeenv-troubleshooting

Conversation

@mmcky

@mmcky mmcky commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Documents a local dev-environment gotcha that currently blocks tox and editable installs: a stale in-repo .nodeenv/ (left over from an older pinned Node.js version) aborts the build with a nodeenv-version-mismatch error before any tests run. This surfaced while setting up a clean local environment to test #404.

No code or toolchain change — docs only. The fix is simply to delete the git-ignored .nodeenv/ and let sphinx-theme-builder rebuild it.

What this adds to docs/developer/setup.md

  • A Troubleshooting section showing the nodeenv-version-mismatch error and its one-line fix (rm -rf .nodeenv then rebuild), with a pointer to the node-version pin under [tool.sphinx-theme-builder] in pyproject.toml.
  • An "Everything stays repo-local" note clarifying that tox isolates the toolchain to the repository — .tox/, .nodeenv/, and node_modules/ are all git-ignored and regenerated, so the test/build environment never touches the base/global Python or Node.

Verification

After rm -rf .nodeenv, the isolated tox -e py313-sphinx7 run provisions a fresh .nodeenv, compiles assets, installs the [test] extras, and passes the full suite (106 tests) — confirming the documented remedy.

Note on Node versions

For context (not changed here): sphinx-theme-builder pins its internal Node to 20.18.0 in pyproject.toml, while .nvmrc, the dev docs, and CI's visual jobs use Node 24. These serve different paths (stb's packaging build vs. the npm/Playwright build) and both work today, so I've left the pin alone. If we'd prefer stb to also build on Node 24 for consistency, that can be a separate follow-up.

🤖 Generated with Claude Code

Document the `nodeenv-version-mismatch` error that occurs when the in-repo
`.nodeenv/` is left over from an older pinned Node.js version — it aborts
`tox` and `pip install -e .` before tests can run. The fix is to delete
`.nodeenv/` and let sphinx-theme-builder rebuild it.

Also clarify that `tox` keeps the toolchain fully repo-local (`.tox/`,
`.nodeenv/`, `node_modules/` are all git-ignored and regenerated), so the
test/build environment never touches the base/global Python or Node.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 19, 2026 03:32
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot temporarily deployed to pull request June 19, 2026 03:33 Inactive
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@e635acb). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #405   +/-   ##
=======================================
  Coverage        ?   47.75%           
=======================================
  Files           ?        2           
  Lines           ?      423           
  Branches        ?        0           
=======================================
  Hits            ?      202           
  Misses          ?      221           
  Partials        ?        0           
Flag Coverage Δ
pytests 47.75% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds developer documentation for a common local setup failure mode where a stale, git-ignored .nodeenv/ (created by sphinx-theme-builder) blocks tox / editable installs due to a Node version mismatch, and clarifies which build/test artifacts stay repo-local.

Changes:

  • Documented that tox, .tox/, .nodeenv/, and node_modules/ are repo-local and safe to delete/recreate.
  • Added a troubleshooting section for nodeenv-version-mismatch, including the one-line remediation (rm -rf .nodeenv).
  • Recorded the documentation update in CHANGELOG.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/developer/setup.md Adds “repo-local” clarification and a troubleshooting guide for stale .nodeenv/ blocking tox / editable installs.
CHANGELOG.md Notes the new developer setup troubleshooting documentation under Unreleased.

Comment thread docs/developer/setup.md
Comment on lines +84 to +88
there, never into your base/global Python. The theme's SCSS/JS assets are
compiled by `sphinx-theme-builder`, which provisions its own Node.js into an
in-repo `.nodeenv/` (with `node_modules/` for `npm`). All three directories are
git-ignored, so nothing leaks system-wide and the environment can always be
rebuilt from scratch by deleting them.
Comment thread docs/developer/setup.md
and the expected version of NodeJS (v20.18.0).
```

your in-repo `.nodeenv/` is stale — it was provisioned against an older pinned
@github-actions

Copy link
Copy Markdown
Contributor

🎭 Visual Regression Test Results

passed  103 passed
skipped  3 skipped

Details

stats  106 tests across 1 suite
duration  3 minutes, 53 seconds
commit  4703243

Skipped tests

desktop-chrome › theme.spec.ts › Visual Regression Tests › prob-matrix - full page screenshot
mobile-chrome › theme.spec.ts › Visual Regression Tests › prob-matrix - full page screenshot
mobile-chrome › theme.spec.ts › Theme Features › f-string interpolation styling

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants