---
title: Troubleshooting
description: What each error and warning from vite-plugin-ngp means and what to do about it, grouped by where you meet it, and how to report a bug.
---

# Troubleshooting

This page is for when the dev server, `vite build` or a spec stopped with a message you don't recognise. Search the page for the start of your message. Each heading is the message as it's printed, with `...` where it names your file or value, or a symptom when there's no message to search for. Most of the plugin's own messages end with `See https://push-based.github.io/vite-plugin-ngp/troubleshooting/#...`, which opens their entry here.

Each entry says what the message means, why it happens and what to do, and links the page with the detail. Messages from Angular, Rolldown, TypeScript or Yarn are here only where the plugin is why you see them. If yours isn't here, [make a minimal reproduction](troubleshooting#make-a-minimal-reproduction) and [file a bug](troubleshooting#file-a-bug).

## Installing, and the platform

### `has no native ngp engine for ...` {#no-native-engine}

The package carries native engines for macOS on arm64 and x64, and for glibc Linux on x64 and arm64. Alpine and other musl Linux, and Linux on any other CPU, have none: set [`engine: 'wasm'`](configuration#engine), which took up to twice as long as native on a real app. Windows has no native engine either, and the wasm engine fails there too, because it reads paths by Unix rules and can't find the app's tsconfig, so the message says so and the plugin [doesn't run on Windows yet](status#what-doesnt-work-yet). Run it under WSL 2, which gets the Linux engine. A native Windows engine is [#148](https://github.com/push-based/vite-plugin-ngp/issues/148).

### `no ngp build found` {#no-ngp-build}

This copy of the plugin has no ngp build in it. The package from npm carries one, so you're running the plugin from a clone of the repo, or a link to one. Set the `toolchain` option or [`NGP_TOOLCHAIN`](configuration#environment-variables) to an ngp build, such as the repo's `toolchain/out` after `pnpm toolchain`. [Building](https://github.com/push-based/vite-plugin-ngp/blob/main/docs/building.md) has the steps.

### `... not found. Build ngp with ...` {#toolchain-file-missing}

`toolchain` or `NGP_TOOLCHAIN` points at a folder, but `preprocessor/api.js`, or the engine the plugin needs, isn't in it. The message names the file it looked for. Point the option at `toolchain/out` itself, not at the repo root, and run `pnpm toolchain` to the end if it stopped part way. [Building](https://github.com/push-based/vite-plugin-ngp/blob/main/docs/building.md)

### `The requested module '@angular/compiler' does not provide an export named ...` {#angular-too-old}

Your Angular is older than the plugin accepts. ngp imports names from `@angular/compiler` that first shipped in `22.3.0-rc.0`; on `22.2.7`, loading it stops with this message, naming `PotentialTopLevelReadsVisitor`. Move every `@angular/*` package to one 22.3 release. [Compatibility](compatibility) lists the releases that were run.

### `'router-outlet' is not a known element`, with Yarn {#yarn-pnp}

On Yarn's Plug'n'Play, the first build fails like this for every Angular element. ngp's analyzer reads Angular's type declarations from files on disk, and Plug'n'Play keeps packages in zip files. Set `nodeLinker: node-modules` in `.yarnrc.yml` and install again. An app from [`create-ngp`](creating-an-app) has that file already. [Status](status#what-doesnt-work-yet)

### `All versions satisfying "..." are quarantined` {#yarn-quarantine}

Yarn 4.19.0 doesn't install a version npm has had for less than 24 hours. On 2 December 2026, a new `app-ssr` app stopped with this on `@angular/common@npm:22.3.2`, 15 hours after Angular published it. The templates pin exact versions, the plugin's own among them, so expect the same for a day after each plugin release; that part is reasoned from the one failure, not run. Wait a day, or install once with `YARN_NPM_MINIMAL_AGE_GATE=0 yarn install`. [Creating an app](creating-an-app#where-this-is-weak)

## When Vite starts

The plugin checks its options when `vite.config.ts` calls `ngp()`, and a few more once Vite knows its root. These messages stop the dev server, `vite build` and Vitest before anything compiles.

### `... must be ..., not ...` {#invalid-option}

An option has a value it doesn't take. The message names the option and quotes what you passed:

| The message starts | The option takes |
|---|---|
| `engine must be 'native' or 'wasm'` | `'native'`, the default, or `'wasm'` |
| `typeChecker must be 'tsgo' or 'tsrs'` | `'tsgo'`, the default, or `'tsrs'` |
| `test.extendedDiagnostics must be 'warning'` | `'warning'`, or nothing |
| `cache.dir must be a path` | A string that isn't empty, relative to Vite's root or absolute |
| `workspaceRoot must be a path` | The same |

Fix the value. [Configuration](configuration#options) has every option's type.

### `cache.dir is ..., which holds Vite's root` {#cache-dir-holds-root}

`cache: {dir}` names Vite's root, or a folder Vite's root is inside, such as the workspace root. The cache is 256 folders of JSON files, and they'd land among your sources. Name a folder for the cache alone, such as `node_modules/.cache/vite-plugin-ngp`. [Reusing output between builds](how-it-works#reusing-output-between-builds) says what goes in it.

### `no tsconfig found in ...` {#no-tsconfig}

The plugin looks in Vite's root for `tsconfig.app.json`, then `tsconfig.json`, and under Vitest for `tsconfig.spec.json` before both. The message lists the files it tried. It most often means Vite's root isn't your app's folder, such as a `vite.config.ts` at the top of a monorepo with no `root` set. Set `root`, or name the file with the `tsconfig` option, relative to Vite's root. [Configuration](configuration#options)

### `ssr.server is ..., and ... does not exist` {#ssr-server-missing}

`ssr: {server}` names a file that isn't there. The path resolves from Vite's root. Fix it, or leave the option out: without it the plugin takes `src/server.ts` when that file exists, and renders without a server file when it doesn't. [Server rendering](server-rendering#with-angular-ssr)

### `i18n with @angular/ssr is not supported yet` {#i18n-with-angular-ssr}

The app depends on `@angular/ssr`, and the `i18n` option is set. Per-locale server bundles work only with a `render(url, document)` server entry. Switch to a [`render` entry](server-rendering#the-server-entry), or drop one of the two. [Status](status#what-doesnt-work-yet) lists it.

### `NG4003`, `NG4004`, `NG4005`: `Angular compiler option "extendedDiagnostics..." ...` {#angular-compiler-options}

Your tsconfig's `angularCompilerOptions.extendedDiagnostics` has a setting ngc refuses to compile with. The text is Angular's own:

- **NG4003**: `extendedDiagnostics` is set next to `strictTemplates: false`. Remove one.
- **NG4004**: a category, `defaultCategory` or one in `checks`, isn't `error`, `warning` or `suppress`.
- **NG4005**: `checks` names a check that doesn't exist. The message lists the names it accepts.

The plugin stops, as ngc does, because ngp alone would compile on with every extended check turned off, and you'd never know. [Type-checking](type-checking#angulars-extended-diagnostics) has how `extendedDiagnostics` works.

### `The ... path in file replacements does not exist.` {#file-replacement-missing}

A `fileReplacements` entry's `with` file is missing. The path resolves from Vite's root. The message is the Angular CLI's, word for word, so it carries no link here. [Migrating from ng build](migrating-from-ng-build#file-replacements)

## In the dev server

### `'...' is not a known element`, after you delete a component {#deleted-component}

You deleted a component another template still uses. Angular's error names the element, not the missing file. Search your templates for the selector, and remove the use or restore the component. [Status](status#where-its-weakest)

### A component's styles are gone, with no error {#styles-missing}

A `styleUrl` that names a missing file isn't reported. Check the path in the decorator, relative to the component's `.ts` file. [Status](status#where-its-weakest)

### A file under `libs/` answers 403 {#libs-403}

Vite serves files from outside its root only inside the workspace it detects. When it doesn't detect yours, add `server.fs.allow` with the workspace root to the config. [Migrating inside Nx](nx#vites-root-is-the-apps-folder)

## HMR

### `HMR update for ... failed, reloading: ...` {#hmr-update-failed}

The plugin couldn't build an in-place update for your edit, so it reloaded the page instead. Your edit is on the page either way. What follows `reloading:` is the cause.

One cause has its own wording: `... changed on disk, and the watcher never reported it`. You edited a template while its component's `.ts` file held a change the watcher hadn't reported. The template may use members only the new class has, so the plugin waits up to a second for that report, and reloads when it doesn't come. A tool that writes files outside your editor, such as a formatter or `git checkout`, can get there first. The reload loads both files as they are on disk.

If the same file fails on every edit, [file a bug](troubleshooting#file-a-bug) with the message. [How it works](how-it-works#component-hmr)

### `HMR failed for ...: .... Reloading.` {#hmr-failed}

Angular's runtime in the browser couldn't apply a component update and asked for a reload. The text after the colon is Angular's reason. The plugin reloads the page, which loads your edit. [How it works](how-it-works#component-hmr)

### A component is broken after an in-place update {#broken-after-update}

An update was applied, and it left the component in a state a reload doesn't produce. Set [`hmr: false`](configuration#hmr), so every edit reloads the page, and [file a bug](troubleshooting#file-a-bug) saying what you edited, so the rule that let the update through can be fixed.

## In builds

### `"..." is not exported by "..."`, for a type {#type-reexport}

Rolldown stopped the build at a re-export of an interface or a type. A per-file compiler can't tell that `export {SomeInterface} from './x'` names a type, so it compiles to a runtime re-export of nothing. Write `export type {SomeInterface} from './x'`. TypeScript's `isolatedModules` check reports every such re-export as TS1205, and its quick fix writes the `export type`. [Migrating inside Nx](nx#libraries-compile-with-the-app)

### A module fails to load, with `emitDecoratorMetadata` on {#decorator-metadata}

With `emitDecoratorMetadata: true` in a tsconfig, Vite's per-file transform emits each constructor parameter's type at runtime. A type that's an interface survives as an import of nothing, and the module fails to load. Angular needs no decorator metadata: turn it off for Vite with `oxc: {decorator: {legacy: true, emitDecoratorMetadata: false}}`, or drop it from the tsconfig. TypeScript's check for this is TS1272. [Migrating inside Nx](nx#libraries-compile-with-the-app)

### The build's output looks stale {#stale-output}

Build once with `cache: false`. If that fixes it, the cache served a module whose key is missing an input, which is a bug: [file it](troubleshooting#file-a-bug). Deleting `node_modules/.vite/vite-plugin-ngp/cache` clears the cache once. [Configuration](configuration#cache)

### `... budgets exceeded: ...` {#budgets-exceeded}

At least one budget's `error` size was exceeded. The lines above the message, marked `✘ [ERROR]`, say which and by how much. Lines marked `▲ [WARNING]` are budgets over their `warning` size, which don't stop the build. Make that part of the app smaller, or raise the budget in `budgets`. [Migrating from ng build](migrating-from-ng-build#budgets)

### `Failed to link ... in ...: ...` {#failed-to-link}

The plugin runs Angular's linker over every Angular library the app imports, and the linker couldn't turn one declaration into code. The message names the declaration and the library's file; the text after the last colon is the linker's. When it says `This application depends upon a library published using Angular version ..., which requires Angular version ... or newer`, the library was built with a newer Angular than yours: move your Angular up, or the library down. For anything else, [file a bug](troubleshooting#file-a-bug) naming the library and its version. [How it works](how-it-works#linking-libraries)

## Type-checking

### `typeChecker: 'tsrs' needs the tsrs package` {#tsrs-not-installed}

You set `typeChecker: 'tsrs'`, and tsrs isn't installed in the app. The check reports this as its one error until it is, in the terminal and the overlay, and `vite build` fails with it. Run `npm install -D tsrs`, or remove the option to check with `tsgo`. [Type-checking](type-checking#checking-with-tsrs)

### tsrs says the platform isn't supported {#tsrs-platform}

tsrs ships binaries for macOS on Apple silicon and for Linux on x64 and arm64, glibc and musl. An Intel Mac has none. Remove `typeChecker: 'tsrs'` to check with `tsgo`. [Type-checking](type-checking#checking-with-tsrs)

### `type-check failed: ...` {#type-check-failed}

The check itself broke, not your code: the plugin couldn't write the check's files or run the checker, and the stack after the message says where. It happens in the dev server, which goes on serving; the last errors it reported stand until a check gets through, and the next edit tries again. If it fails the same way every time, [file a bug](troubleshooting#file-a-bug) with the stack. To work without the check meanwhile, set [`typeCheck: false`](configuration#options).

### `tsgo exited with code ...`, `tsrs exited with code ...` {#checker-exited}

The checker stopped without printing a single error, which is a crash or a missing binary, and the lines after the message are what it printed. The plugin reports it as a type error, so `vite build` fails with it. If the output says a file is missing, install again. Otherwise, [file a bug](troubleshooting#file-a-bug) with the output.

### `error TS2688: Cannot find type definition file for '...'` {#ts2688}

Your Vite `cacheDir` is outside the project, and your tsconfig lists `types`. The check's tsconfig lives in `cacheDir`, and TypeScript resolves `types` entries such as `vite/client` from there. Move `cacheDir` back inside the project; the default, `node_modules/.vite`, works. [Type-checking](type-checking#where-its-weak)

### `error TS5090: Non-relative paths are not allowed when 'baseUrl' is not set` {#ts5090}

TypeScript 7, which runs the check, refuses a `paths` target that doesn't start with `./` when there's no `baseUrl`. Write each target as `./libs/...`. [Migrating from ng build](migrating-from-ng-build#typescript-7-is-stricter) has the rest, and [Migrating inside Nx](nx#tsconfig-paths-resolve-through-vite) the workspace setup.

## Server rendering

### `... doesn't export a reqHandler made by createNodeRequestHandler or createRequestHandler` {#no-req-handler}

A warning, once per dev server. Your server file, `src/server.ts` or `ssr.server`, exists but has no `reqHandler` export the plugin recognises. It recognises the function by a marker that `createNodeRequestHandler` and `createRequestHandler` put on it, so a handler under another name, or wrapped in a function of your own, isn't found. Pages still render, but your server's own routes, such as an API, don't answer in dev. Export it as `export const reqHandler = createNodeRequestHandler(app);`. [Server rendering](server-rendering#with-angular-ssr)

### `... index.html is missing: the browser build has to run before the server build` {#browser-build-first}

With `@angular/ssr`, once the server bundle is written, the plugin reads the browser build's `index.html` to write the server's manifests and to prerender. It wasn't in the browser's output folder. `vite build` builds the browser first, so the server was built alone, or before it: by a `builder.buildApp` of your own, say. Run `vite build` with Vite's default order. [Server rendering](server-rendering#with-angular-ssr)

### `prerendering failed:` {#prerendering-failed}

Each line after it is a route with Angular's error for it, or an error from reading the routes. The plugin loads the server bundle in a worker, reads the routes, running each `getPrerenderParams`, and renders every `Prerender` route, each within 30 seconds. Two kinds of line need explaining:

- **`<route>: Angular rendered nothing for it`**: Angular's server app returned no response for the route, as it does when no route in your server routes matches the URL.
- **A timeout**: rendering the route, or reading the routes, took longer than 30 seconds, such as waiting on an HTTP request to a server that isn't running at build time.

Fix what the line names, or give the route `RenderMode.Server`, so it renders on request instead. [Server rendering](server-rendering#with-angular-ssr)

### A missing page answers 200 {#not-found-200}

The `render` contract returns HTML only, so behind your own server a not-found page answers 200. Use `@angular/ssr` for status codes, redirects and headers. [Server rendering](server-rendering#limits)

## i18n

### `devLocale '...' is neither the source locale nor in i18n.locales.` {#unknown-dev-locale}

`devLocale` names a locale you didn't configure. Use the source locale or a key of `i18n.locales`. [Internationalization](i18n#the-dev-server)

### `... is not a translation file in a format @angular/localize reads.` {#not-a-translation-file}

None of the parsers `@angular/localize` has, for XLIFF 1.2 and 2.0, XTB, JSON and ARB, can read the file. XMB is a format to extract to, not to translate from: its translations come back as XTB. Check that the path in `i18n.locales` names the translation file and not something else, and that the file is complete. [Internationalization](i18n#extract-the-messages)

### `... says it is for locale '...'.` {#translation-locale-mismatch}

A warning. The file's header names a locale, and that code appears nowhere in the file's path as `.de.` or `/de/`. Mostly that's the wrong file under a locale. If the file is right, rename it to carry its code, such as `messages.de.xlf`, and the warning stops. [Internationalization](i18n#setup)

### `No Angular locale data for '...'. Pipes will format in en-US.` {#no-locale-data}

A warning. Angular has no locale data for the code in `@angular/common/locales/global/`, nor for a shorter form of it: `de-CH` falls back to `de`. Check that the code is a real locale, such as `de` or `pt-BR`, not a file name or a language name. [Internationalization](i18n#the-build)

### `[...] No translation found for ...` {#missing-translation}

A warning, once per locale and message: a translation file lacks a message the app uses, and the build keeps the source text for it. Add the message to that locale's file. Set `missingTranslation: 'error'` to fail the build instead, or `'ignore'` to drop the warning. [Internationalization](i18n#options)

### `unknown format '...'`, `unknown --duplicates '...'` {#extract-unknown-option}

`ngp-extract-i18n` got a `--format` other than `xlf`, `xlf2`, `xmb`, `json` and `arb`, or a `--duplicates` other than `error`, `warning` and `ignore`. [Internationalization](i18n#extract-the-messages)

### `message extraction failed` {#extraction-failed}

You ran `ngp-extract-i18n` with `--duplicates error`, and two messages share an id with different text. The lines after it name them. Give one an id of its own with `@@`, make the texts match, or extract with the default, `--duplicates warning`. [Internationalization](i18n#extract-the-messages)

## Vitest

### An option in `vite.config.ts` doesn't reach your specs {#option-missing-in-specs}

When a project has a `vitest.config.ts`, Vitest reads only that file, and both files call `ngp()`. Put an option your specs need in `vitest.config.ts` too, or merge the two. [Configuration](configuration#one-config-or-two)

### `NG8001: '...' is not a known element`, in a spec {#spec-not-known-element}

A spec file declares its own components, or tests a component that isn't standalone, and the element comes from a scope TestBed puts together at runtime. Compiling one file can't see that scope. Set [`test: {runtimeScopes: true}`](testing#specs-written-for-jit), which drops NG8001 to NG8004 in those components, or make the host standalone.

### A spec file runs no tests after an extended diagnostic {#spec-extended-diagnostic}

An extended diagnostic your tsconfig makes an error, such as an unused standalone import (NG8113), fails every spec file that imports the component. Set [`test: {extendedDiagnostics: 'warning'}`](testing#specs-written-for-jit), or make the checks warnings in `tsconfig.spec.json`.

### `test.externalLibraries needs pool 'forks' or 'threads'` {#external-libraries-pool}

`test.externalLibraries` links libraries with a hook in Node's loader, and Vitest's `vmThreads` and `vmForks` pools load external modules themselves, past that hook. Use `pool: 'forks'` or `'threads'`, or leave the option off. [Testing with Vitest](testing#libraries-left-to-node)

### `the test module has already been instantiated` {#testbed-already-instantiated}

The second `configureTestingModule` in a file found the first test's TestBed. Add `afterEach(() => getTestBed().resetTestingModule())` to your setup file: Angular registers that itself only when `afterEach` is a global, and Vitest's globals are off by default. [Testing with Vitest](testing#setup-node-on-the-server-platform)

### `Component '...' has unresolved metadata` {#unresolved-metadata}

The spec overrides a component used only inside `@defer`. Such a component gets its decorator metadata asynchronously, and TestBed resolves that only in `compileComponents()`. Call it in the spec, or set [`test: {jitCompat: true}`](testing#specs-written-for-jit), which keeps `@defer` dependencies static, as JIT did.

### `$localize is not defined`, in a spec {#localize-not-defined}

The `i18n` option sets up `$localize` through your app's entry modules, which specs don't import. Add `import '@angular/localize/init';` at the top of your test setup file. [Internationalization](i18n#limits)

### A type error in a spec doesn't fail it {#spec-type-errors}

Vitest strips types without checking them. Template errors ngp finds do fail the spec file; type errors elsewhere don't. Run `tsc` over your specs separately. [Testing with Vitest](testing#limits)

## ngp-generate

### `Not overwriting ...` {#generate-not-overwriting}

`ngp-generate` never overwrites a file. One of the files it would write exists, so it wrote none of them. Pick another name, or delete the files it names first. Its other messages name the file or option to change. [Generating code](generating-code)

## Make a minimal reproduction

A bug report the maintainers can run gets fixed. One they have to rebuild from a description mostly doesn't. Start from a new app, and add only what it takes to show the problem:

```bash
npm create @push-based/ngp@latest -- repro --template app
```

Use `--template app-ssr` if the problem is in server rendering, and add `--monorepo` if it needs a library next to the app ([Creating an app](creating-an-app#options)). Install, run what fails, and copy over the one component, option or file from your app that makes it fail. If it doesn't fail in the new app, the difference between the two apps is the next thing to look at.

Run the failing command with `DEBUG=vite-plugin-ngp` set, which logs every module ngp compiles, and each template update's timings, to stderr. Keep the output. Then push the app to a public repository.

## File a bug

First check [Status](status): what the plugin doesn't do yet is listed there, and yours may be one of them. Then try `ng build` on the same app. If it's wrong there too, the bug is in Angular, and Angular's issue tracker is the place for it. If only the plugin gets it wrong, including output that differs from `ng build`'s, it belongs here.

[Open a bug report](https://github.com/push-based/vite-plugin-ngp/issues/new?template=bug_report.md) with:

- the reproduction's repository, or the steps if they're a few lines;
- the full message, with its stack if it has one, from the terminal and from the browser console;
- the versions of `@push-based/vite-plugin-ngp`, `@angular/core`, `vite` and Node, and your OS and CPU;
- what you expected to happen instead.
