Raph117
Raph117

Reputation: 3821

VS Code Intellisense can't find function called 'debug'

I'm working on a Remix JS project, and in order to debug I have to export a function called 'debug'.

However, for some reason VSCode's intellisense can't find it. It offers this: enter image description here

if I enter another function exported from the same module it finds it without problems:enter image description here

Here is the module I'm importing from:


export function debug() {
    return;
}

export function hello() {
    return "hi";
}

I have no idea why this is happening... Any help would be appreciated!

Upvotes: 0

Views: 85

Answers (1)

Raph117
Raph117

Reputation: 3821

OK, found the issue.

You need to install @types/debug and @types/react. VS Code doesn't like .js or .jsx projects without those packages.

And my .jsconfig needed to look like this:

{
    "compilerOptions": {
        "baseUrl": ".",
        "checkJs": true,
        "jsx": "react"
    },
    "exclude": [
        "public",
        "netlify"
    ]
}

Upvotes: 1

Related Questions