Git Product home page Git Product logo

Comments (9)

qm3ster avatar qm3ster commented on May 26, 2024 1

Seems like this is something where you have to do the nasty thing known as declaration merging :(

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

dropping the above into your index.d.ts seems to fix it.

from typescript-template.

kevinmarrec avatar kevinmarrec commented on May 26, 2024 1

@husayt Lol your node_modules seems to be broken. nuxt-ts-edge should'nt have @nuxt inside it πŸ˜‚. Try resintalling all your dependencies

from typescript-template.

husayt avatar husayt commented on May 26, 2024

In latest nuxt-edge @kevinmarrec had added typings for process, but i still get the following error in nuxt.config.ts

Property 'static' does not exist on type 'Process'.

from typescript-template.

kevinmarrec avatar kevinmarrec commented on May 26, 2024

@husayt You're probably missing "@nuxt/vue-app-edge" in tsconfig.json.
Here is my current tsconfig.json :

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "node",
    "lib": [
      "esnext",
      "esnext.asynciterable",
      "dom"
    ],
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "sourceMap": true,
    "strict": true,
    "noImplicitAny": true,
    "noEmit": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "./*"
      ]
    },
    "types": [
      "@types/node",
      "@nuxt/vue-app-edge"
    ]
  }
}

It will bee soon become

{
  "extends": "nuxt-ts-edge"
}

So that everything work out of the box with default values in the extended tsconfig.json.

from typescript-template.

husayt avatar husayt commented on May 26, 2024

Thanks @kevinmarrec.

I tried "types": ["@types/node", "@nuxt/vue-app-edge"] and it didn't work.
and then i changed it to
"types": ["@types/node", "nuxt-ts-edge/node_modules/@nuxt/vue-app-edge"] and that worked.
It's bit ugly bot does the job. Might be a good idea to add @nuxt to peer/high level dependency of nuxt-ts-edge.

from typescript-template.

AndrewBogdanovTSS avatar AndrewBogdanovTSS commented on May 26, 2024

Is it valid to close this bug until it's really fixed in a stable version of Nuxt?

from typescript-template.

husayt avatar husayt commented on May 26, 2024

@kevinmarrec indeed damn NPM. Thank you very much.
By the way, I had finally some time to port hackernews to TS and commit it here

Your feedback will be most appreciated.

from typescript-template.

kevinmarrec avatar kevinmarrec commented on May 26, 2024

@husayt Will give my feedback when I'll find some time ;) Thanks for working on it !

from typescript-template.

bitdom8 avatar bitdom8 commented on May 26, 2024

Hi guys, any update? Cannot find name 'process'. Do you need to install type definitions for node? Try npm i --save-dev @types/node.

from typescript-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.