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.

Cannot find name ts(2304)

See original GitHub issue

Hello brliant developer and thanks for youe dedicated work on Volar plugin! image Now I use Volar version 0.33.10 and there is a bug:Cannot find name '...' .ts(2304) errors are displayed on all variables returned in the setup function. I have viewed issues about ts(2304) and try to add in *.d.ts,but it seems make no effect.

declare module "@vue/runtime-dom" {
  import type { DefineComponent } from "vue";
  const component: DefineComponent<{}, {}, any>;
  export default component;
}

It confused me for a long time. I try to install old verisons, but it still occured. And I noticed a situation is that when I create this program, it’ok. After I change formatter tool to “Prettier”, this problrm seems to occur. I tried to switch back, there is no effect. “@vue/runtime-dom”: “3.2.31”, “vue”: “3.2.31”. Thanks for your work!😁

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
johnsoncodehkcommented, Apr 11, 2022

@Kylyi, @benkroeger these should be different issues, and it should be fixed in 0.34.4.

0reactions
Zizacocommented, Apr 13, 2022

@johnsoncodehk I just fixed the problem by updating vscode. It seemed to be a mismatch between the version of volar and vscode.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeScript getting error TS2304: cannot find name ' require'
I am getting the error "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node. js page.
Read more >
TS2304: Cannot find name 'Request' · Issue #661 - GitHub
When compiling a Typescript file that uses MeiliSearch for Node.js, the error TS2304: Cannot find name 'Request' causes the build to fail.
Read more >
TypeScript error TS2304 cannot find name require - Edureka
The error that I'm getting is the "TS2304: Cannot find name 'require' " when I attempt to transpile a simple TypeScript Node.js page....
Read more >
Fix the Cannot Find Name 'require' Error in TypeScript
To fix the “cannot find name 'require'” error in TypeScript, install the @types/node package into your project by running npm i -D @types/node...
Read more >
Typescript getting error TS2304 cannot find name ' require'
When we try to get a TypeScript running, we get this error: "TS2304: Cannot find name 'require' " when we attempt to transpile...
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