VS Code extension crashes with “ReferenceError: process is not defined” in multi-root workspaces
What version of the IDE extension are you using?
26.5721.30844 (pre-release)
What subscription do you have?
ChatGPT 200 usd Pro subscription
Which IDE are you using?
VS Code 1.130.0 (x64)
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
When I open the Codex sidebar in a VS Code multi-root workspace, the entire sidebar is replaced by the generic error boundary:
Something went wrong
The actual exception captured from the Codex WebView is:
ReferenceError: process is not defined
Object.resolve app-initial-D5k9IjTG.js:116:74145
Object.relative app-initial-D5k9IjTG.js:116:74145
app-initial-BIdl5ORJ.js:2:8159
Mc app-initial-BIdl5ORJ.js:2:8088
fln app-initial-CYUddJaD.js:530:48951
The failing code path filters or compares workspace roots using the bundled path implementation:
Nc.default.posix.relative(Ni(e), Ni(t))
The bundled browser path implementation eventually calls process.cwd(), but the VS Code WebView does not expose the Node.js process global.
This reproduces after clearing both the extension state and the WebView cache, so it does not appear to be caused by stale state, authentication, networking, or regional access.
What steps can reproduce the bug?
- Create two folders:
project-a/
project-b/
- Create a multi-root workspace file:
{
"folders": [
{ "path": "project-a" },
{ "path": "project-b" }
]
}
- Open the
.code-workspacefile in VS Code. - Open the Codex sidebar.
- If necessary, click “Retry” or “New task”.
- The sidebar displays the generic error page, and the WebView console reports
ReferenceError: process is not defined.
What is the expected behavior?
The Codex sidebar should render the task list and composer normally in a multi-root workspace.
Additional information
As a diagnostic workaround, defining a minimal process object before the WebView application bundle loads prevents the crash:
globalThis.process ??= {
cwd: () => "/",
env: {},
platform: "win32",
versions: {}
};
After adding this shim locally, clearing the WebView cache, and restarting VS Code:
- The task list and model selector rendered normally.
- “New task” worked.
- The error boundary did not reappear.
- No
Runtime.exceptionThrownor console errors were observed for more than 60 seconds.
This workaround is only evidence for the root cause and is not proposed as the final implementation. Ideally, the workspace-root filtering code should use a WebView-safe path implementation that does not depend on the Node.js process global.
Additional information
_No response_
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
For those also sufferring from this:
If you are seeing the generic “Something went wrong” page in the Codex VS Code sidebar while using a multi-root workspace, you may be hitting a WebView compatibility bug rather than an authentication or network problem.
The extension compares your workspace roots using a bundled
path.posix.relative()implementation. That implementation eventually callsprocess.cwd(), but VS Code WebViews do not provide Node.js’s globalprocessobject. With multiple workspace roots, this produces:You can apply the following temporary workaround:
webview\assetsand make a backup copy.CacheStoragedirectory so that VS Code does not continue serving the old cached bundle.It will be located somewhere under:
The numeric ID is specific to your VS Code profile. Do not blindly delete a particular numbered directory copied from another user. Back up or move the directory instead of permanently deleting it.
After the new bundle is loaded, the sidebar should render normally because
process.cwd()is now available to the bundled path implementation.This is only a local compatibility workaround. Updating or reinstalling the Codex extension will probably overwrite the modified JavaScript file. The proper upstream fix is for the extension to use a browser-safe path implementation that does not depend on Node.js’s global
processobject.Confirmed independently on Windows with extension 26.5721.30844 and VS Code Insiders 1.131.0-insider. The failure was the same unguarded call in app-initial-D5k9IjTG.js:
Replacing that single call with:
restored the Codex webview after reload.
the beta version works correctly on the same machine and with the same project state.
The issue is reproducible in stable version 26.721.3996.0, but does not reproduce in the current beta build.
The problematic project state contained two rootPaths
The stable build crashed with:
ReferenceError: process is not defined
name=AppRoutes
Please let me know if you need the exact beta version number or additional logs.
Independent confirmation on Windows with Codex extension
26.5721.30844.The Codex panel remains stuck on “Oops, an error has occurred” after:
This workspace is intentionally multi-root / multi-repository because the development work involves cross-app integrations and shared functions across repositories. Opening only one repository is therefore not a usable workaround: it removes the cross-repository context required for the work and effectively makes the Codex extension unusable.
Please treat this as a blocking regression for real multi-repository development workflows, rather than an optional workspace edge case.