Skip to content

vp check fails JS functions cannot be represented as a serde_json::Value #1300

Closed as duplicate

Description

@shyim

Describe the bug

❯ vp check 
VITE+ - The Unified Toolchain for the Web

error: Formatting could not start
Failed to load configuration file.
/Users/shyim/Developer/shopmon/frontend/vite.config.mjs
Error: JS functions cannot be represented as a serde_json::Value
Ensure the file has a valid default export of a JSON-serializable configuration object.

Formatting failed before analysis started

My vite.config.mjs

import { URL, fileURLToPath } from "node:url";

import tailwindcss from "@tailwindcss/vite";
import Vue from "@vitejs/plugin-vue";
import IconsResolver from "unplugin-icons/resolver";
import Icons from "unplugin-icons/vite";
import Components from "unplugin-vue-components/vite";
import { defineConfig } from "vite-plus";

const hmr = {};

if (process.env.HMR_PORT) {
  hmr.clientPort = process.env.HMR_PORT;
}

export default defineConfig({
  fmt: {},
  plugins: [
    tailwindcss(),
    Vue(),
    Components({
      resolvers: [
        IconsResolver({
          prefix: "icon",
        }),
      ],
    }),
    Icons({
      autoInstall: true,
      scale: 1,
    }),
  ],
  resolve: {
    alias: {
      "@": fileURLToPath(new URL("./src", import.meta.url)),
    },
  },
  server: {
    hmr,
    proxy: {
      "/api": {
        target: process.env.SHOPMON_API_URL || "https://shopmon.fos.gg",
        changeOrigin: true,
      },
    },
  },
});

When I uncomment all plugins it works.

Reproduction

x

Steps to reproduce

No response

System Info

ITE+ - The Unified Toolchain for the Web

Environment:
  Version  24.14.1
  Source   lts

Tool Paths:
  node  /Users/shyim/.vite-plus/js_runtime/node/24.14.1/bin/node
  npm   /Users/shyim/.vite-plus/js_runtime/node/24.14.1/bin/npm
  npx   /Users/shyim/.vite-plus/js_runtime/node/24.14.1/bin/npx



VITE+ - The Unified Toolchain for the Web

vp v0.1.15

Local vite-plus:
  vite-plus  v0.1.15

Tools:
  vite             v8.0.3
  rolldown         v1.0.0-rc.12
  vitest           v4.1.2
  oxfmt            v0.43.0
  oxlint           v1.58.0
  oxlint-tsgolint  v0.18.1
  tsdown           v0.21.7

Environment:
  Package manager  npm v11.12.1
  Node.js          v24.14.1

Used Package Manager

npm

Logs

Validations

Activity

  1. added theissue type on Apr 4, 2026
  2. leaysgur commented on Apr 6, 2026

    @leaysgur
    Contributor

    NOTE:

    • vp check finds vite.config.mjs (not .ts)
    • Then vp check calls oxfmt and oxlint with -c vite.config.mjs
    • But oxlint and oxfmt only treat .ts as vite.config
    • In this case, this results in the same situation as specifying a standard JS config, and since it cannot be serialized into valid JSON, an error occurs
  3. leaysgur commented on Apr 6, 2026

    @leaysgur
    Contributor

    @fengmk2 Let me confirm... (if you know it,)

    In Vite+, vite.config.ts is the only config file extension? Or does it support all file extensions supported by Vite?

  4. shyim commented on Apr 6, 2026

    @shyim
    Author

    Can confirm renaming it to vite.config.ts fixes it

  5. fengmk2 commented on Apr 6, 2026

    @fengmk2
    Member
  6. leaysgur commented on Apr 6, 2026

    @leaysgur
    Contributor

    Thanks, let's track in #930 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions