Skip to content

Vite plugin outputs prerender files to wrong directory on workerd environment #13801

Open
@kigawas

Description

@kigawas

Potential fix: change process.cwd() in this line
to viteConfig.root

I'm using React Router as a...

framework

Reproduction

Go here and run pnpm build, you'll see prerender route output to a wrong place

https://stackblitz.com/edit/github-7kwnry9f?file=home%2Fprojects%2Fgithub-7kwnry9f%2Fbuild%2Fclient%2Findex.html

System Info

Not related.

Used Package Manager

pnpm

Expected Behavior

The file should be generated to build/client folder

Actual Behavior

The file was generated to current folder under a long path like: ./Users/user/react-router-project/build/client/index.html (note this is under current project directory

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions