Runtime

You might say

It is all JavaScript code—why does running it suddenly say window is not defined?

The execution environment that runs your code and supplies host capabilities such as browser windows, files, or timers.The same JavaScript language can read window, document, and localStorage inside a browser runtime, yet throws window is not defined when executed in a Node.js server runtime; conversely, filesystem APIs like fs exist on Node.js, not in the browser. A runtime is the host environment, not the language syntax or your code editor.
Runtime Environment

You can say this to an AI Agent

Ready to paste into Cursor, Claude Code, or Codex
Structured AI Agent prompt

Running the page throws ReferenceError: window is not defined in the terminal. Check whether that file is executing in the Node.js server runtime or the browser runtime, move any window or localStorage access behind a client-only browser boundary, and verify both clean server rendering and working browser behavior.

Want your Agent to translate plain-language UI ideas automatically?Install free VibeHub Skill →
Oil UI Pro. Push AI’s design skills to the limit. Usability, existing projects and stricter review.
Further reading