A JavaScript error occurred in the main process

Resolved 💬 4 comments Opened Feb 4, 2026 by caichuanwang Closed Feb 4, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

260203.1501 (523)

What subscription do you have?

no

What issue are you seeing?

when i open codex first time , the give a error, title is "A JavaScript error occurred in the main process" and content is "Uncaught Exception:
Error: ENOTDIR: not a directory, mkdir '/Users/myname/.codex/sqlite'
at Object.mkdirSync (node:fs:1349:26)
at Ct (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main.js:37:2164)
at Object.<anonymous> (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main.js:552:14481)
at Module._compile (node:internal/modules/cjs/loader:1769:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1902:10)
at Module.load (node:internal/modules/cjs/loader:1488:32)
at Module._load (node:internal/modules/cjs/loader:1307:12)
at c._load (node:electron/js2c/node_init:2:17999)
at node:electron/js2c/browser_init:2:139583
at node:electron/js2c/browser_init:2:139792"

I can not open codex now!!!

About my env:
Apple m1 Pro
16G
macOS version: 15.3.1

When i quit codex, a error alse show me ,the title is "A JavaScript error occurred in the main process" and the content is "Uncaught Exception:
ReferenceError: Cannot access 'zt' before initialization
at EventEmitter.<anonymous> (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main.js:552:14195)
at EventEmitter.emit (node:events:520:35)
at o.emit (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/main.js:511:5950)"

What steps can reproduce the bug?

just opent it

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

etraut-openai contributor · 6 months ago

I wonder if the app package is corrupt. Please try downloading a new copy and see if that fixes the problem.

caichuanwang · 6 months ago

Thank you for your reply, but after downloading and installing a new installation package, this problem still occurs
the url for me to download: https://openai.com/zh-Hans-CN/codex/get-started/

etraut-openai contributor · 6 months ago

Based on the stack crawl, it looks like there is something wrong with the /Users/myname/.codex/sqlite path. Perhaps there's an existing file with that name, so the app isn't able to create a directory in that location. You could try deleting the ~/.codex directory.

caichuanwang · 6 months ago

you are right !! thanks. this issue can close now