Skip to content

Included override of Process type makes svelte-check fail #2483

@benmccann

Description

@benmccann

Describe the bug

I get the following with svelte-check version 4 in the SvelteKit repo:

====================================
Loading svelte-check in workspace: packages/kit/test/apps/embed
Getting Svelte diagnostics...

packages/kit/test/apps/embed/../../../../../node_modules/.pnpm/@types+node@18.19.48/node_modules/@types/node/globals.d.ts:43:9
Error: Subsequent variable declarations must have the same type.  Variable 'process' must be of type 'Process & { browser: boolean; }', but here has type 'Process'. 

    var process: NodeJS.Process;
    var console: Console;


packages/kit/test/apps/embed/../../../../../node_modules/.pnpm/@types+node@18.19.48/node_modules/@types/node/process.d.ts:5:13
Error: Subsequent variable declarations must have the same type.  Variable 'process' must be of type 'Process & { browser: boolean; }', but here has type 'Process'. 
    global {
        var process: NodeJS.Process;
        namespace NodeJS {


====================================
svelte-check found 2 errors and 0 warnings in 2 files
 ELIFECYCLE  Command failed with exit code 1.

This seems to be caused by code from this repo:

./node_modules/.pnpm/svelte-check@4.0.0_svelte@4.2.17_typescript@5.4.5/node_modules/svelte-check/dist/src/svelte-shims.d.ts:declare var process: NodeJS.Process & { browser: boolean }
./node_modules/.pnpm/svelte-check@4.0.0_svelte@4.2.17_typescript@5.4.5/node_modules/svelte-check/dist/src/svelte-shims-v4.d.ts:declare var process: NodeJS.Process & { browser: boolean }
./node_modules/.pnpm/svelte2tsx@0.7.6_svelte@4.2.17_typescript@5.4.5/node_modules/svelte2tsx/svelte-shims.d.ts:declare var process: NodeJS.Process & { browser: boolean }
./node_modules/.pnpm/svelte2tsx@0.7.6_svelte@4.2.17_typescript@5.4.5/node_modules/svelte2tsx/svelte-shims-v4.d.ts:declare var process: NodeJS.Process & { browser: boolean }

Reproduction

See the branch https://github.com/sveltejs/kit/tree/svelte-check-4 from sveltejs/kit#12646

Expected behaviour

I can upgrade svelte-check to v4 without issue

System Info

  • OS: Linux
  • IDE: N/A

Which package is the issue about?

svelte-check

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy