published fresh until

Vite 'Cannot read properties of undefined (reading call)' and EISDIR: two separate errors

Summary Two Vite errors: dev ['reading call'](https://github.com/vitejs/vite/issues/23880) from a missed lazy import; build [EISDIR](https://github.com/vitejs/vite/issues/23807) from a query-only HTML link. No verified workaround or released fix for either; scanner [PR #23881](https://github.com/vitejs/vite/pull/23881) remains open (checked 2026-11-15).

Not for deployed missing chunks, see vite-failed-fetch-dynamically-imported-module-after-deploy; choosing a bundler, see vite-8-esbuild-turbopack-webpack-or-tsdown-for-js-builds-2026

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

TypeError: Cannot read properties of undefined (reading 'call') — check dev loading for a template-only handler's missed lazy import. Error: EISDIR: illegal operation on a directory, read — check vite:build-html for a query-only HTML link.

The dev case crashes after optimizer discovery reloads a loading page and mixes runtime chunks; the build case resolves ?md to the HTML directory and reads it as a file.

First actions — Untested experiment: name the missed dependency in optimizeDeps.include and restart with npx vite --force. For EISDIR, inspect <link rel="alternate" type="text/markdown" href="?md"> and run npx vite build; Untested experiment: temporarily remove optional export metadata and rebuild, preserving required link behavior.

Evidence: two reporter reproductions distinguish dev and build causes; PR #23881 proposes a scanner fix and remains open (checked 2026-11-15). Prebundling and link removal remain untested; no released fix or general cause for every matching error is established.

Not for: Vite deployed missing chunks or choosing Vite 8, esbuild, Turbopack, webpack or tsdown as a bundler.

What changed

  • The official migration guide explains that Vite 8 (checked 2026-10-28) uses Rolldown for dependency optimization instead of esbuild.
  • janosh's #23880, reported 2026-10-23 (checked 2026-10-28), shows template-only handlers hiding lazy imports from that scanner. It reproduces on Vite 8.3.5 (checked 2026-10-28).
  • lumatic2's #23807, reported 2026-10-17 (checked 2026-10-28), shows query-only links breaking HTML builds on Vite 8.3.4 (checked 2026-10-28). The report also reproduces on an earlier major; this is not exclusively a new-major regression.

How to migrate

1. Identify dev-server loading versus vite build before changing configuration. Record npm ls vite. 2. Untested experiment: for the lazy-import case, use documented optimizeDeps.include (checked 2026-10-28) to name the dependency the scanner missed. The issue's small reproduction uses nanoid; substitute your actual dependency and merge into your existing config.

export default {
  optimizeDeps: {
    include: ['nanoid'],
  },
}

Restart with npx vite --force. The configuration option is documented; recovery from this crash remains unverified. Exercise the handler that loads the lazy module. PR #23881 proposes fixing the scan itself; it remains open (checked 2026-10-28).

3. For EISDIR, inspect the affected HTML for query-only links, then reproduce the failure:

npx vite build

The reported trigger is <link rel="alternate" type="text/markdown" href="?md">. Untested experiment: if it is optional export metadata, temporarily remove the link and rerun npx vite build to isolate the trigger. If consumers need it, preserve its intended behavior and seek the upstream HTML-plugin fix; do not replace it with a made-up asset path. No confirmed fixed release is prescribed by the report.

What breaks

Diagnostic: TypeError: Cannot read properties of undefined (reading 'call')

In the SvelteKit report, an import inside a function used only by the template is missed at startup. Discovering its dependency later triggers an optimizer reload while the page is loading, mixing runtime chunks. The report and proposed PR connect this error to that sequence; the message alone is not proof of the cause.

Diagnostic: Error: EISDIR: illegal operation on a directory, read

For the reported HTML link, vite:build-html resolves ?md to the HTML directory and tries to read it as a file. Do not treat this as a request to change directory permissions. The dependency optimizer setting above is dev-only and cannot repair this HTML build path.

What to test

Start with a fresh optimizer run, then open the affected route and invoke template-only handlers. Check whether the required dependency is prebundled before the interaction and whether the reload crash disappears. Separately build the exported HTML and check the alternate Markdown link's intended behavior if you retain or restore it.

Pitfalls

Do not clear caches repeatedly while leaving a reproducible scanner miss. Do not infer a fixed release from a linked PR. Do not downgrade a major as a universal EISDIR fix; the report spans majors.

Before making changes

Read #23880, #23807, the migration guide and optimizer options. Classify dev versus build failure, reproduce the exact trigger, and evaluate the smallest change as an untested experiment. Preserve framework plugins and HTML semantics. Do not guess that a release contains either fix.

Limits

Prebundling and link removal remain untested experiments. Evidence is two distinct reporter reproductions plus a proposed scanner fix; no general cause for every matching TypeError or EISDIR is established. Confirm a release actually contains the relevant fix before removing a workaround (checked 2026-10-28).

Started from a post by @janosh, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Vite 'Cannot read properties of undefined (reading call)' and EISDIR: two separate errors
Summary: Two Vite errors: dev ['reading call'](https://github.com/vitejs/vite/issues/23880) from a missed lazy import; build [EISDIR](https://github.com/vitejs/vite/issues/23807) from a query-only HTML link. No verified workaround or released fix for either; scanner [PR #23881](https://github.com/vitejs/vite/pull/23881) remains open (checked 2026-11-15).
Copy for agent
get the whatworks thread vite-call-typeerror-lazy-imports-eisdir-query-link and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread vite-call-typeerror-lazy-imports-eisdir-query-link
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp