temporalio / temporalio/sdk-typescript
[Bug] API sidebar generation fails on Windows path separators
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 917
- Forks
- 224
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 43
Description
What are you really trying to do?
Build the SDK's API reference locally on Windows.
Describe the bug
At 04922a0096d9d9c5fb1cf1ba15d19fadc6b90574, Docusaurus generates the API Markdown but fails loading packages/docs/sidebars.js:
TypeError: Cannot read properties of undefined (reading 'toLowerCase')
at titleCase (packages/docs/sidebars.js:9:14)
at packages/docs/sidebars.js:18:24
The script obtains a native path with path.relative(...), then splits it on / to obtain the category. On Windows, a generated namespace page produces api\namespaces\workflowStreamsClient, so url.split('/')[1] is undefined. This prevents loading the sidebar regardless of the page's Markdown content.
Minimal Reproduction
After the workspace dependencies and build from CONTRIBUTING are available, run from the repository root on Windows:
pnpm -C packages/docs exec docusaurus build
Once API files have been generated, loading the sidebar alone reproduces the same error:
node -e "require('./packages/docs/sidebars.js').referenceSidebar"
The separator mismatch can also be demonstrated without installing the SDK, on any Node platform:
const path = require('node:path');
const url = path.win32.relative(
'C:/sdk/packages/docs/docs',
'C:/sdk/packages/docs/docs/api/namespaces/client.md'
).replace(/\.md$/, '');
console.log(url); // api\namespaces\client
console.log(url.split('/')[1]); // undefined
Expected: sidebar generation handles the generated native paths while producing forward-slash document IDs. A possible remedy is normalizing the relative path before category extraction and ID construction.
Environment/Versions
- Windows x64, Node 24.14.1.
- SDK source:
04922a0096d9d9c5fb1cf1ba15d19fadc6b90574; currentmainstill has the same sidebar blob (c14996bec51dd76b630e40f7fdd3292e2bfd9657). - Local source/docs build; no Temporal server, Docker, Kubernetes, or deployment involved.
Additional context
I invoked Docusaurus directly because the build-docs script's POSIX inline environment assignments stop earlier under Windows cmd. This report concerns the independently reproduced sidebar path handling, not that shell syntax.
The docs CI runs on Ubuntu, so this is not a claim that the hosted reference or deployment is broken. I could not find an explicit Windows docs-build support policy. If that workflow is intentionally POSIX-only, documenting the prerequisite would clarify the boundary. No implementation has been started, in accordance with the contribution guide's discussion-before-development requirement.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/docs/sidebars.js, especially titleCase and the referenceSidebar construction, then run pnpm -C packages/docs exec docusaurus build on Windows or the provided Node reproduction. Done means the generated native paths load without the undefined toLowerCase error and produce forward-slash document IDs; verify with node -e "require('./packages/docs/sidebars.js').referenceSidebar".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js, typescript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100