question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IntelliSense error in H3Event

See original GitHub issue

Environment

“nitropack”: “0.4.24”

Reproduction

https://stackblitz.com/edit/github-xukg4p-mpwena?file=routes%2Findex.ts,package.json

Describe the bug

export default defineEventHandler((event) => {
  event.res.statusCode = 204;
  event.res.end();
});

IntelliSense error:

Property 'statusCode' does not exist on type 'ServerResponse'.(2339)

Seems like the error is in:

// node_modules/h3/dist/index.d.ts:1
import http, { OutgoingMessage } from 'http';

should be this:

import * as http from 'http';
import { OutgoingMessage } from 'http';

Additional context

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
NozomuIkutacommented, Sep 2, 2022

One possible solution is to enable esModuleInterop. For example, on developer’s side:

// tsconfig.json
{
  "extends": "./.nitro/types/tsconfig.json",
  "compilerOptions": {
    "esModuleInterop": true
  }
}

Refs:

0reactions
pi0commented, Sep 2, 2022

Updated stackblitz with latest h3 and types/node still not working… Any ideas @danielroe ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

intellisense errors when using visual studio force include
I force include the windows.h file, and the intellisense can work as normal. My visual studio is 16.9.4. enter image description here.
Read more >
Add VS IntelliSense Error on interface containing function with ...
Add Visual Studio IntelliSense Error on HTMLElement interface containing a function with the same name as an variable on a derived Element ...
Read more >
IntelliSense incorrect error for constructor is inaccessible
Purpose would be having a pure virtual class with a constructor with arguments. Could have that be a public constructor since it can't...
Read more >
Fixing Visual Studio Intellisense Errors - Rick Strahl's Web Log
I ran into a problem in one of my applications where Visual Studio was showing errors that were clearly not actual errors.
Read more >
Configure a C++ project for IntelliSense - Microsoft Learn
Tag parser errors appear in the Error List window. Validate project settings with diagnostic logging. To check whether IntelliSense compiler is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found