You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/vue-next instead.
13:42:50 [vite] Internal server error: Failed to parse JSON file.
Plugin: vite:json
File: xxx/locales/de.json?url
at formatError (xxx\node_modules\vite\dist\node\chunks\dep-1bdbec90.js:45829:46)
at TransformContext.error (xxx\node_modules\vite\dist\node\chunks\dep-1bdbec90.js:45825:19)
at TransformContext.transform (xxx\node_modules\vite\dist\node\chunks\dep-1bdbec90.js:46873:22)
at Object.transform (xxx\node_modules\vite\dist\node\chunks\dep-1bdbec90.js:46027:53)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async transformRequest (xxx\node_modules\vite\dist\node\chunks\dep-1bdbec90.js:61624:29)
at async xxx\node_modules\vite\dist\node\chunks\dep-1bdbec90.js:61732:32
Due to imported json being first transformed into a JS module:
exportdefault'/locales/en.json';
before getting processed by the JSON Plugin which can't parse the JSON because it's an JS module..
Reproduction
I think the problem is obvious, I can imagine that the ?url part needs to be handled first before the json plugin kicks in.
System Info
vite version: 2.0.4
Operating System: Windows 10 Pro
Node version: v14.15.5
Package manager (npm/yarn/pnpm) and version: 7.5.6
Describe the bug
I'm trying to use static url imports like the following:
Raises the following error:
Due to imported json being first transformed into a JS module:
before getting processed by the JSON Plugin which can't parse the JSON because it's an JS module..
Reproduction
I think the problem is obvious, I can imagine that the
?url
part needs to be handled first before the json plugin kicks in.System Info
vite
version: 2.0.4Logs (Optional if provided reproduction)
The text was updated successfully, but these errors were encountered: