Bug: `worker: true` returns malformed parse results in Vite v8 production builds
Author: milachaeCreated May 27, 2026Updated Sep 9, 2026
After upgrading a project from Vite v7 to v8, PapaParse parsing breaks in production builds when using worker: true.
The same code works correctly:
- in development mode
- in Vite v7
- when
worker: false
Expected behavior
Parsing a CSV with:
Papa.parse(csv, {
header: true,
worker: true,
})should return parsed rows in data.
Example:
{
"data": [
{
"property": "reportName",
"value": "Example",
"type": "string"
}
]
}Actual behavior
The parsed result is malformed:
datacontains onlynullvalues- the actual row contents appear inside
meta.fields
Example output:
{
"data": [null, null, null],
"errors": [],
"meta": {
"fields": [
"property",
"value",
"type",
["reportName", "Example", "string"]
]
}
}This later causes runtime crashes because the application expects parsed row objects.
Notes
What I know so far:
- Regression appeared after upgrading Vite v7 → v8
- Only happens in production builds
- Does not happen in development mode
- Only happens when
worker: true - Setting
worker: falsefixes the issue
Reproduction repository
I created a minimal reproduction repository here.
Steps to reproduce
npm install
npm run build
python3 -m http.server 3000Then open:
http://localhost:3000Source: mholt/PapaParse