Skip to content

TSX: Cannot read property 'flags' of undefined #3959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
s-panferov opened this issue Jul 21, 2015 · 1 comment
Closed

TSX: Cannot read property 'flags' of undefined #3959

s-panferov opened this issue Jul 21, 2015 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@s-panferov
Copy link

Minimal example to reproduce:

/// <reference path="./react.d.ts" />

import * as React from 'react';

class C extends React.Component<any, any> {
    render() {
        return null
    }
}

let C1: React.Component<any, any> = C;
let a = <C1 />;

Trace:

/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:28987
                throw e;
                      ^
TypeError: Cannot read property 'flags' of undefined
    at getApparentType (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:12754:21)
    at getPropertyOfType (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:12830:20)
    at getTypeOfPropertyOfType (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:11889:24)
    at getJsxElementAttributesType (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:16075:46)
    at checkJsxOpeningLikeElement (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:16138:40)
    at checkJsxSelfClosingElement (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:15860:13)
    at checkExpressionWorker (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:17893:28)
    at checkExpression (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:17804:42)
    at checkExpressionCached (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:17765:38)
    at getTypeForVariableLikeDeclaration (/Users/panferov/Workspace/out/TypeScript/bin/tsc.js:11968:24)

Command to run:

tsc --jsx react --target es6 issue.tsx

Compiler is the latest:

commit 4e85864b2dca574152134d532851708cecec1c3c

Here is the repo https://github.com/s-panferov/ts-jsx-issue

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jul 21, 2015
@RyanCavanaugh
Copy link
Member

See #3903 (fix pending at #3942)

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants