Static GitHub Issues

[2823] process.client can't be used in TS based environment

prev: npm run dev does not wortk with starter template nuxt
next: Using NUXT.js just for static html generation with script (vendor.js, manifest.js, app,js, pages/index.js, layouts/default.js)

Since I've updated to Nuxt v. 1.3.0 I started getting a deprecation warning inside my middleware functions: context.isClient has been deprecated, please use process.client instead. but I can't change my code to use process.client instead because of TS error:

TS2339: Property 'client' does not exist on type 'Process'.

so it seems like this change was made without TS in mind. A workaround was suggested by @qm3ster

declare namespace NodeJS {
  export interface Process {
    client: boolean
    server: boolean
  }
}

but I guess such considerations should be done on the Nuxt level. The issue was discovered when working with nuxt-community/typescript-template

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2453">#c2453</a>)</em></sub></div>