universal-vue / uvue

Vue CLI plugin to create universal Vue applications with ease
https://universal-vue.github.io/docs/
MIT License
127 stars 13 forks source link

Type conflict #42

Closed jfcieslak closed 4 years ago

jfcieslak commented 4 years ago

Describe the bug Subsequent property declarations must have the same type. Property 'env' must be of type 'ProcessEnv', but here has type '{ [name: string]: string; }'.ts(2717) globals.d.ts(848, 9): 'env' was also declared here.

//@uvue/core/global.d.ts
declare namespace NodeJS {
  export interface Process {
  // env should be type: ProcessEnv
    env: {
      [name: string]: string;
    };
    ssr: boolean;
    spa: boolean;
    client: boolean;
    server: boolean;
    prod: boolean;
    test: boolean;
    dev: boolean;
  }
}

To Reproduce This type error is a typings collision ts(2717) caused by the fact that env is also declared in globals.d.ts(848, 9)

Reproduction repo/demo link

Expected behavior Should not get a type error from ts

Additional context

Please indicate versions of:

node: v12.13.1
vue-cli:  4.1.1
uvue: 0.1.1
os: mac os catalina 10.15.1
browser: chrome
lsotoangeldonis commented 4 years ago

Hi hope it helps, had the same issue a work around is to put "skipLibCheck": true in your tsconfig.json under "compilerOptions".