Circular dependencies
When two modules import each other, values can be undefined at load time:
// a.js
import { b } from './b.js';
export const a = () => b();
// b.js
import { a } from './a.js';
export const b = () => a(); // may be undefined on first call
Because modules are hoisted and evaluated once, circular imports often work if you call across at runtime rather than at module top level. Design to avoid cycles when possible.