6.0.0-beta.x regression, array of data imported as JSON file get transformed to an object, why? #18533
Closed
7 tasks done
Labels
p4-important
Violate documented behavior or significantly improves performance (priority)
regression
The issue only appears after a new release
Describe the bug
I have a JSON file with the following structure
when I import the file via an import, it is returning an array (good) of data in Vite 5.x but in 6.x it imports the same file as an object (bad) for unknown reason when I expect it to remain an array. This seems like a regression when comparing to Vite 5.x
Reproduction
https://stackblitz.com/edit/vitejs-vite-qwnzvw?file=main.js
Steps to reproduce
Just run the Stackblitz provided.
running the same Stackblitz with Vite 5.x I get this

but running with Vite 6.0-beta, I get this (notice the prototype changes to Object instead of Array)

System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: