[plugin:vite:esbuild] Transform failed - Importing JSON files with { type: "json" }; #385
Open
7 tasks done
Labels
bug: upstream
Bug in a dependency of Vite
Describe the bug
Reproduction here: https://stackblitz.com/edit/vitejs-vite-no1xpg?file=src%2FApp.tsx
I am trying to import
json
files, with code like so:But running it with
vite
causes it to crash with this error:Strange enough, in the stacktrace, it shows line 3 and 4 with missing braces like so:
import enUs from "../locales/en-US.json" with type: "json";
even though the actual code has braces like so:{ with type: "json" }
.Using
npm:vite@^5.4.11
npm:react@^18.3.1
npm:@vitejs/plugin-react@^4.3.3
npm:@deno/vite-plugin@^1.0.0
Reproduction
https://stackblitz.com/edit/vitejs-vite-no1xpg?file=src%2FApp.tsx
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
Validations
The text was updated successfully, but these errors were encountered: