GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Load `vite.config.ts` from Oxlint|Oxfmt LSP creates a stray `.svelte-kit` folder at the monorepo root · Issue #1756 · voidzero-dev/vite-plus

Load vite.config.ts from Oxlint|Oxfmt LSP creates a stray .svelte-kit folder at the monorepo root #1756

New issue
Copy link
New issue
Copy link
Closed
Bug
#1764
Closed
Load vite.config.ts from Oxlint|Oxfmt LSP creates a stray .svelte-kit folder at the monorepo root#1756
Bug
#1764
Copy link
Assignees
jong-kyung
Labels
bugSomething isn't working
Milestone
Beta

Description

@leaysgur
leaysgur
opened on Jun 3, 2026
Issue body actions

Original: oxc-project/oxc#22949

After looking into it, this is what I found:

  • Vite+ monorepo w/ SvelteKit
  • Actual SvelteKit project is located under apps/web or etc, not repository root
  • When Oxlint (and/or Oxfmt) LSP reads its vite.config.ts via resolveConfig()
  • It triggers Vite's config|configResolved hook, then .svelte-kit directory is created
    • https://github.com/sveltejs/kit/blob/9cdca56634c24c56e5bca25d26b03d46b3ef8e9c/packages/kit/src/exports/vite/index.js#L500-L503

Well then,

  • Is there a way to read config without being detected by Vite...?
  • Or is it possible to do so without triggering hooks?
  • Or ignore plugins for this usage somehow?
  • Or need to tell config directory to Vite?

Doesn't it apply to CLI usage?

Reacted by JongKyung Lee

Activity

  1. fengmk2 commented on Jun 4, 2026

    @fengmk2
    fengmk2
    on Jun 4, 2026
    Member
    More actions

    In vp CLI, we can use lazyPlugins to solve this kind of issue:

    import { defineConfig } from 'vite-plus';
    import { sveltekit } from '@sveltejs/kit/vite';
    
    export default defineConfig({
      // plugins: [sveltekit()],
      plugins: lazyPlugins(() => [sveltekit()]),
    });

    @jong-kyung improved them in PR #1752. After the next version is released, the vp create / migrate commands will handle them by default.

    So I think it is necessary to extend lazyPlugins to support environment checks for oxlint/oxfmt CLI execution.

    Reacted by JongKyung Lee
  2. leaysgur commented on Jun 4, 2026

    @leaysgur
    leaysgur
    on Jun 4, 2026
    ContributorAuthor
    More actions

    I see.

    So, in terms of the answer for the user, it's something like:

    • Please wrap it using lazyPlugins() in the vite.config.ts for now
    • In the future, vp create|migrate will handle this automatically

    Is that about right?

    Reacted by JongKyung Lee and MK (fengmk2)
  3. fengmk2 commented on Jun 4, 2026

    @fengmk2
    fengmk2
    on Jun 4, 2026
    Member
    More actions

    @leaysgur yes

    Reacted by Yuji Sugiura
  4. OrientusPrime commented on Jun 4, 2026

    @OrientusPrime
    OrientusPrime
    on Jun 4, 2026
    More actions

    By the way, I was already using sveltekit by wrapping it with lazyPlugin(). It wasn't solving the problem, at least for me. Just so you know.

    Reacted by JongKyung Lee
  5. fengmk2 commented on Jun 4, 2026

    @fengmk2
    fengmk2
    on Jun 4, 2026
    Member
    More actions

    @OrientusPrime Can you provide a repository that reproduces the issue?

  6. jong-kyung commented on Jun 4, 2026

    @jong-kyung
    jong-kyung
    on Jun 4, 2026
    Collaborator
    More actions

    I created a minimal reproduction repo: https://github.com/jong-kyung/repro-vite-plus-1756

    To reproduce:

    1. Clone/install the project.
    2. Open the repository root in VS Code with the OXC extension enabled.
    3. Run Developer: Reload Window.

    After the reload, the issue is reproduced: .svelte-kit is created both at the repository root and under apps/web.

    cc. @leaysgur @fengmk2

    Reacted by MK (fengmk2) and Yuji Sugiura
  7. jong-kyung commented on Jun 4, 2026

    @jong-kyung
    jong-kyung
    on Jun 4, 2026
    Collaborator
    More actions

    @fengmk2 The issue seems to be that the LSP wrappers only set VP_VERSION, but lazyPlugins() relies on VP_COMMAND to skip framework plugins for lint/fmt. What do you think about setting VP_COMMAND ??= 'lint' in bin/oxlint and VP_COMMAND ??= 'fmt' in bin/oxfmt? This would match the normal vp lint/vp fmt resolver path and avoid executing SvelteKit while OXC loads vite.config.ts.

  8. fengmk2 commented on Jun 4, 2026

    @fengmk2
    fengmk2
    on Jun 4, 2026
    Member
    More actions

    @jong-kyung It looks like something was missed. Can you fix it?

  9. fengmk2
    added this to the Beta milestone on Jun 4, 2026
  10. jong-kyung commented on Jun 4, 2026

    @jong-kyung
    jong-kyung
    on Jun 4, 2026
    Collaborator
    More actions

    @fengmk2 Sure, I’ll take this and open a PR.

    Reacted by MK (fengmk2) and Yuji Sugiura
  11. jong-kyung
    self-assigned this
    on Jun 4, 2026
  12. jong-kyung
    added
    bugSomething isn't working
    on Jun 4, 2026
  13. jong-kyung
    added the
    Bug
    issue type on Jun 4, 2026
  14. fengmk2
    added a commit that references this issue on Jun 4, 2026

    fix(cli): set VP_COMMAND in oxlint/oxfmt LSP wrappers (#1764)

    This issue will close once commit 857b062 is merged into the 'main' branch.
    857b062
  15. fengmk2
    closed this as completedin #1764on Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @jong-kyung
    jong-kyung

Labels

bugSomething isn't working

Type

Bug

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    • Beta

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.