Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply origin changes
  • Loading branch information
actions-user committed Oct 1, 2026
commit 6e6de4ecf44ce7b7c819f96f9d2a049cfc45157f
8 changes: 8 additions & 0 deletions guide/api-environment-frameworks.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,11 @@ await builder.buildApp()
- **Type:** `(this: MinimalPluginContextWithoutEnvironment, builder: ViteBuilder) => Promise<void>`
- **Kind:** `async`, `sequential`
- **Scope:** [Global](/guide/api-environment-plugins#per-environment-hooks-and-global-hooks)

const server = await createServer({
const ssrEnvironment = server.environments.ssr
const server = await createServer({
const ssrEnvironment = server.environments.ssr
await ssrEnvironment.runner.import('virtual:entrypoint')
ssrEnvironment.hot.send('request', serialize({ req, uniqueId }))
ssrEnvironment.hot.on('response', (data) => {
1 change: 1 addition & 0 deletions guide/api-environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
In dev, Vite executes the server code in the same Node process as the Vite dev server, giving a close approximation to the production environment. However, it is also possible for servers to run in other JS runtimes, like [Cloudflare's workerd](https://github.com/cloudflare/workerd) which have different constraints. Modern apps may also run in more than two environments, e.g. a browser, a node server, and an edge server. Vite 5 didn't allow these environments to be properly represented.
15 changes: 14 additions & 1 deletion guide/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
See: [Chrome issue](https://bugs.chromium.org/p/chromium/issues/detail?id=110649#c8)
The hash key used to invalidate optimized dependencies depends on the package lock contents, the patches applied to dependencies, and the options in the Vite config file that affects the bundling of node modules. This means that Vite will detect when a dependency is overridden using a feature as [npm overrides](https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides), and re-bundle your dependencies on the next server start. Vite won't invalidate the dependencies when you use a feature like [npm link](https://docs.npmjs.com/cli/v9/commands/npm-link). In case you link or unlink a dependency, you'll need to force re-optimization on the next server start by using `vite --force`. We recommend using overrides instead, which are supported now by every package manager (see also [pnpm overrides](https://pnpm.io/settings#overrides) and [yarn resolutions](https://yarnpkg.com/configuration/manifest/#resolutions)).
Node.js inspector will generate `vite-profile-0.cpuprofile` in the root folder. You can pass `--profile <name>` (or `--profile=<name>`) to write `<name>.cpuprofile` instead. Go to https://www.speedscope.app/, and upload the CPU profile using the `BROWSE` button to inspect the result.
Node.js inspector will generate `vite-profile-0.cpuprofile` in the root folder. You can pass `--profile <name>` (or `--profile=<name>`) to write `<name>.cpuprofile` instead. Go to https://www.speedscope.app/, and upload the CPU profile using the `BROWSE` button to inspect the result.
### Illegal operation error when watching files

If the file or directory is located on a file system that does not support file system events, Vite may be unable to watch it.

An example error you may encounter is:

```
Error: EISDIR: illegal operation on a directory, watch 'C:/Users/me/project/vite.config.js'
```

For example, this can happen with a VirtualBox shared folder.

To solve this, you can enable [`server.watch.usePolling`](/config/server-options#server-watch). Note that [`usePolling` leads to high CPU utilization](https://github.com/paulmillr/chokidar/tree/3.6.0#performance).
Loading