Home / Function/ hmrClient() — vite Function Reference

hmrClient() — vite Function Reference

Architecture documentation for the hmrClient() function in client.ts from the vite codebase.

Entity Profile

Dependency Diagram

graph TD
  36cfd4e6_42e7_48c2_7764_01bf218d89ac["hmrClient()"]
  85908ff5_4d12_826d_8235_531f91538758["client.ts"]
  36cfd4e6_42e7_48c2_7764_01bf218d89ac -->|defined in| 85908ff5_4d12_826d_8235_531f91538758
  style 36cfd4e6_42e7_48c2_7764_01bf218d89ac fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/vite/src/client/client.ts lines 150–169

    ? async function importUpdatedModule({
        url,
        acceptedPath,
        isWithinCircularImport,
      }) {
        const importPromise = import(base + url!).then(() =>
          // @ts-expect-error globalThis.__rolldown_runtime__
          globalThis.__rolldown_runtime__.loadExports(acceptedPath),
        )
        if (isWithinCircularImport) {
          importPromise.catch(() => {
            console.info(
              `[hmr] ${acceptedPath} failed to apply HMR as it's within a circular import. Reloading page to reset the execution order. ` +
                `To debug and break the circular import, you can run \`vite --debug hmr\` to log the circular dependency path if a file change triggered it.`,
            )
            pageReload()
          })
        }
        return await importPromise
      }

Domain

Subdomains

Frequently Asked Questions

What does hmrClient() do?
hmrClient() is a function in the vite codebase, defined in packages/vite/src/client/client.ts.
Where is hmrClient() defined?
hmrClient() is defined in packages/vite/src/client/client.ts at line 150.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free