Skip to content

svelte-check overrides vite mode to production for dev-server #2840

@AndersRobstad

Description

@AndersRobstad

Describe the bug

If you run svelte-check whilst having a dev-server running, svelte-check will override the vite mode to production. This makes it so that you either have to kill the dev-server before running svelte-check, or restart it every time after running svelte-check.

Reproduction

  1. Run vite dev
  2. Run svelte-kit sync && svelte-check --tsconfig ./tsconfig.json
  3. See that the mode of the vite-server has changed to production

Below is an example of screenshots showing that the environment is logged as development when starting the server, and inside the svelte-check process its logged as production. When visiting the dev-server after having ran svelte-check the configurations dependent on the environment has changed to production settings. Which in our case is the CSP-directives that are defined in the svelte-config.js file which are different between production and development enviroments.

Image Image Image

Expected behaviour

I would expect to be able to run svelte-check whilst having a dev-server running without the environment being changed, or at least that its reset to development.

System Info

  • OS: MacOS
  • IDE: Cursor / VSCode
  • Terminal: Warp

Which package is the issue about?

svelte-check

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions