Skip to content

Type reference to require import resolves to static side #34802

Closed
@sandersn

Description

@sandersn
// @filename: ex.d.ts
export class C {
  start: number
  end: number
}
// @filename: test.js
const C = require('./ex').C
const C = require('./ex').C;
/** @type {C} c */
var c = new C()

Expected: No error, and completions for c.start and c.end

Actual: Error, "Property 'prototype' is missing in type 'C' but required in type 'typeof C'."

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions