-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
Building documentation with sphinx-js on Windows fails with an OSError: [WinError 193] %1 is not a valid Win32 application error when js_language = 'typescript' is set in conf.py. The build proceeds without error when js_language is left at its default or explicitly set to 'javascript'. This indicates an issue with how sphinx-js invokes the Node.js subprocess with TypeDoc on Windows.
Steps to Reproduce
- Environment:
- OS: Windows 10/11 (x64)
- Python: 3.x (x64)
- Node.js: 18+ (x64)
sphinx-js: Latest version frompiptypedoc: Latest version fromnpm
conf.pysetup:# ... other configurations extensions = [ "sphinx_js", # ... other extensions ] js_source_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "src")) js_language = 'typescript' jsdoc_config_path = "../typedoc.json" # Optional, but tried explicitly to confirm: js_node_executable = r"C:\Program Files\nodejs\node.exe"
- Command: Run
make clean && make htmlfrom thedocsdirectory. - Observe: The build fails with the
WinError 193exception.
Expected Behavior
The documentation should build successfully for TypeScript source files, similar to how it builds for JavaScript. The Node.js subprocess should be invoked correctly by sphinx-js.
Actual Behavior
The build process is terminated with an OSError: [WinError 193], indicating that the subprocess call to Node.js was invalid.
Additional Information
- This error is consistent even after ensuring both Python and Node.js are 64-bit and hardcoding the
node.exepath inconf.py. - Running
where nodeon the affected system showed bothC:\Program Files\nodejs\node.exeandC:\Users\<user>\AppData\Local\Microsoft\WindowsApps\node.cmd. Disabling the WindowsApps alias did not resolve the issue, suggesting a deeper conflict in the subprocess invocation. - The same setup works without issue on a Linux system, confirming the problem is specific to the Windows implementation of
sphinx-js's TypeDoc subprocess handling. - Disabling
js_language = 'typescript'and relying on the JavaScript build works, indicating the core issue is limited to the TypeScript-specific codepath.
Metadata
Metadata
Assignees
Labels
No labels