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.

tsc error with typescript@2.1

See original GitHub issue
antd-tools run compile
components/modal/confirm.tsx(92,7): error TS2531: Object is possibly 'null'.
components/tooltip/index.tsx(127,40): error TS2345: Argument of type 'ReactElement<any> | (undefined & ReactElement<any>) | (null & undefined) | (null & ReactElement<a...' is not assignable to parameter of type '{}'.
  Type 'undefined' is not assignable to type '{}'.
components/tooltip/index.tsx(128,24): error TS2532: Object is possibly 'undefined'.
components/tooltip/index.tsx(128,30): error TS2339: Property 'props' does not exist on type 'ReactElement<any> | (undefined & ReactElement<any>) | (null & ReactElement<any>) | (string & unde...'.
  Property 'props' does not exist on type 'string & undefined'.
components/tooltip/index.tsx(143,33): error TS2345: Argument of type 'ReactElement<any> | (undefined & ReactElement<any>) | (null & undefined) | (null & ReactElement<a...' is not assignable to parameter of type 'ReactElement<any>'.
  Type 'undefined' is not assignable to type 'ReactElement<any>'.
[14:08:49] TypeScript: 5 semantic errors
[14:08:49] TypeScript: emit succeeded (with errors)

And travis is ok.

$ tsc -v
2.0.10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
BANG88commented, Dec 14, 2016

配置jsxpreserve可以不经过TypeScript处理React. 编译出来的 js 跟我们写es6一样.

0reactions
lock[bot]commented, May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

Read more comments on GitHub >

github_iconTop Results From Across the Web

`tsc` error swallowed -- file is treeshaken · Issue #89 - GitHub
raw tsc emit TS2554 error but rollup+rollup-plugin-typescript wouldn't ... https://github.com/ezolenko/rollup-plugin-typescript2 import ...
Read more >
Typescript inherited interface and literal string type key error
However, Typescript 2.1 is giving me a compile error: Cannot invoke an expression whose type lacks a call signature. Type '{ <U>(this: [A ......
Read more >
Documentation - TypeScript 2.1
TypeScript 2.1 supports inheriting configuration using extends , where: extends is a new top-level property in tsconfig. json (alongside compilerOptions , ...
Read more >
Custom Errors in TypeScript 2.1 - Chris Hager
TypeScript 2.1 introduced a number of breaking changes, among them that “Extending built-ins like Error, Array, and Map may no longer work”.
Read more >
TypeScript errors and how to fix them
error TS1192: Module ' json5 ' has no default export. Broken Code ❌. 1, import json5 from 'json5 ...
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