Summary
@netlify/vite-plugin@3.0.1 installs successfully in a Vite 8 project, but vite build fails while loading vite.config.mts when the project uses typescript@7.0.2.
The failure appears to come from the plugin's dependency path through @netlify/dev/@netlify/zip-it-and-ship-it into precinct -> detective-typescript -> @typescript-eslint/typescript-estree -> ts-api-utils. That tooling currently expects the older TypeScript CommonJS API shape.
Environment
node: 24.19.0
npm: 12.0.2
vite: 8.2.0
typescript: 7.0.2
@netlify/vite-plugin: 3.0.1
@netlify/vite-plugin@3.0.1 declares support for Vite 8 and Node >=22.12.0, so the direct package constraints are satisfied.
Minimal config shape
import netlify from "@netlify/vite-plugin";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [netlify()],
});
Actual behavior
tsc -b passes, but vite build fails before the app build starts:
failed to load config from /path/to/vite.config.mts
error during build:
TypeError: Cannot read properties of undefined (reading 'Intrinsic')
at Object.<anonymous> (/path/to/node_modules/ts-api-utils/lib/index.cjs:787:57)
at Module._compile (node:internal/modules/cjs/loader:1872:14)
at Object..js (node:internal/modules/cjs/loader:2003:10)
at Module.load (node:internal/modules/cjs/loader:1594:32)
at Module._load (node:internal/modules/cjs/loader:1396:12)
at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
at Module.require (node:internal/modules/cjs/loader:1617:12)
at require (node:internal/modules/helpers:153:16)
at Object.<anonymous> (/path/to/node_modules/precinct/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js:37:30)
Dependency path
@netlify/vite-plugin@3.0.1
└─ @netlify/dev@5.0.5
└─ @netlify/functions-dev@2.0.5
└─ @netlify/zip-it-and-ship-it@15.5.0
└─ precinct@12.3.2
└─ detective-typescript@14.1.2
└─ @typescript-eslint/typescript-estree@8.69.0
└─ ts-api-utils@2.5.0
@typescript-eslint/typescript-estree@8.69.0 has a TypeScript peer range of >=4.8.4 <6.1.0. With typescript@7.0.2, require("typescript") only exposes:
[ 'version', 'versionMajorMinor' ]
So this line in ts-api-utils crashes because TypeFlags is undefined:
Expected behavior
One of these would work:
@netlify/vite-plugin does not load the TypeScript-analysis dependency path during ordinary Vite config loading/builds unless needed.
- The dependency chain is updated to TypeScript 7-compatible tooling.
- The package documents that TypeScript 7 projects are not currently supported, despite the Vite/Node peer constraints being satisfied.
Reproduction
https://github.com/oleksandr-danylchenko/testing-router-with-netlify-plugin
Notes
This is distinct from installation. The package installs cleanly. The runtime failure happens when Vite loads the config containing netlify().
Summary
@netlify/vite-plugin@3.0.1installs successfully in a Vite 8 project, butvite buildfails while loadingvite.config.mtswhen the project usestypescript@7.0.2.The failure appears to come from the plugin's dependency path through
@netlify/dev/@netlify/zip-it-and-ship-itintoprecinct->detective-typescript->@typescript-eslint/typescript-estree->ts-api-utils. That tooling currently expects the older TypeScript CommonJS API shape.Environment
@netlify/vite-plugin@3.0.1declares support for Vite 8 and Node >=22.12.0, so the direct package constraints are satisfied.Minimal config shape
Actual behavior
tsc -bpasses, butvite buildfails before the app build starts:failed to load config from /path/to/vite.config.mts error during build: TypeError: Cannot read properties of undefined (reading 'Intrinsic') at Object.<anonymous> (/path/to/node_modules/ts-api-utils/lib/index.cjs:787:57) at Module._compile (node:internal/modules/cjs/loader:1872:14) at Object..js (node:internal/modules/cjs/loader:2003:10) at Module.load (node:internal/modules/cjs/loader:1594:32) at Module._load (node:internal/modules/cjs/loader:1396:12) at wrapModuleLoad (node:internal/modules/cjs/loader:255:19) at Module.require (node:internal/modules/cjs/loader:1617:12) at require (node:internal/modules/helpers:153:16) at Object.<anonymous> (/path/to/node_modules/precinct/node_modules/@typescript-eslint/typescript-estree/dist/convert-comments.js:37:30)Dependency path
@netlify/vite-plugin@3.0.1 └─ @netlify/dev@5.0.5 └─ @netlify/functions-dev@2.0.5 └─ @netlify/zip-it-and-ship-it@15.5.0 └─ precinct@12.3.2 └─ detective-typescript@14.1.2 └─ @typescript-eslint/typescript-estree@8.69.0 └─ ts-api-utils@2.5.0@typescript-eslint/typescript-estree@8.69.0has a TypeScript peer range of>=4.8.4 <6.1.0. Withtypescript@7.0.2,require("typescript")only exposes:[ 'version', 'versionMajorMinor' ]So this line in
ts-api-utilscrashes becauseTypeFlagsis undefined:Expected behavior
One of these would work:
@netlify/vite-plugindoes not load the TypeScript-analysis dependency path during ordinary Vite config loading/builds unless needed.Reproduction
https://github.com/oleksandr-danylchenko/testing-router-with-netlify-plugin
Notes
This is distinct from installation. The package installs cleanly. The runtime failure happens when Vite loads the config containing
netlify().