Skip to content

PluginContext missing fs in serve/dev mode #20236

Closed as duplicate of#20200
Closed as duplicate of#20200
@lukeed

Description

@lukeed

Describe the bug

The PluginContext types say that this.fs should exist in plugin hooks like transform or buildStart but it's undefined during dev/serve mode.

Unlike this.emitFile, it does not print a warning message in its place either.

Reproduction

https://stackblitz.com/edit/vitejs-vite-tqyjuqpn?file=index.html,src%2Fmain.ts,vite.config.ts%3AL8&terminal=dev

Steps to reproduce

No response

System Info

vite @ 6.3.5

Used Package Manager

npm

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions