Skip to content

Red squiggly line under code using TSLib constructs #13517

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
Strato opened this issue Jan 16, 2017 · 4 comments
Closed

Red squiggly line under code using TSLib constructs #13517

Strato opened this issue Jan 16, 2017 · 4 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@Strato
Copy link

Strato commented Jan 16, 2017

TypeScript Version:

2.1.4 or 2.1.5

Code

// Red squiggly under 'extends...'
class FooBar extends React.Component<{}, {}> { }

Also on other code using constructs relative to TSLib.

Tooltip error: "This syntax requires an imported helper but module 'tslib' cannot be found".

Expected behavior:

No red squiggly line.

Actual behavior:

Visual Studio 2015 Update 3 reports the line as faulty, when it's not. TypeScript transpilation (through Webpack) works fine.

I had the problem on TypeScript 2.1.4 and expected 2.1.5 to fix it. But it doesn't.

TSLib 1.5.0 is in my package.json dependencies section, and it's in node_modules. tsconfig has importHelpers = true. I DO NOT import the library in my code as the documentation doesn't mention it (no import from 'tslib').

Since it's Visual Studio related I tried to add this line (not documented but makes sense) in my .csproj:

<TypeScriptImportHelpers>True</TypeScriptImportHelpers>

Visual Studio TypeScript compilation is disabled through .csproj as well.

I think it's "TypeScript for Visual Studio" tools related. Am I missing something?

@PavelPZ
Copy link

PavelPZ commented Jan 18, 2017

I have the same problem with Red squiggly line in VS.NET IDE. Other not mentioned observation:

  • Visual Studio project compilation (without WebPack, just Build from VS.NET IDE) works fine with "Build succeeded" message.
  • If I add
    import * as tslib from 'tslib';
    to code, Red line disappears.

Microsoft Visual Studio Community 2015, Version 14.0.25431.01 Update 3
TypeScript for Visual Studio 2015, ver. 2.1.5

@mhegazy mhegazy added the Bug A bug in TypeScript label Jan 21, 2017
@mhegazy mhegazy added this to the TypeScript 2.2 milestone Jan 21, 2017
@vladima vladima added the Fixed A PR has been merged for this issue label Jan 30, 2017
@vladima
Copy link
Contributor

vladima commented Jan 30, 2017

fixed in internal repro

@vladima vladima closed this as completed Jan 30, 2017
@rachelxi
Copy link

@vladima I'm getting the same problem with 2.1.5. Does it mean we can get the bug fixed in next release?

@marcusjwhelan
Copy link

@vladima was this ever resolved? I have the same issues today.

@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
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

6 participants