Typescript: Bug in transpileModule in ts 2.9.1

Created on 6 Jun 2018  路  10Comments  路  Source: microsoft/TypeScript

Please try to reproduce the issue with typescript@next. It may have already been fixed.

TypeScript Version: 3.0.0-dev.20180606 - still fails

Search terms you tried before logging this (so others can find this issue more easily)

transpileModule, 2.9.1

Code

No publicly available repro

This issue was originally raised here

https://github.com/TypeStrong/ts-loader/issues/787#issuecomment-395145357

until it was realized this was a bug with TS itself. It seems transpileModule is dropping valid, needed imports, which is creating runtime errors

Expected behavior:

Used imports will not be dropped

Actual behavior:

They're dropped

Playground Link:

Related Issues:

Bug Fixed

Most helpful comment

All 10 comments

looks like a duplicate of https://github.com/Microsoft/TypeScript/issues/24551. should be fixed by https://github.com/Microsoft/TypeScript/pull/24591.

The fix should be in typescript@next today, and in [email protected] next week.

Can you give typescript@next a try and confirm that my analysis is correct?

@mhegazy - my apologies, I said I had tested with ts@next, and I did, but I think webpack's cache-loader incorrectly served me old (wrong) results. ts@next does indeed work.

Any idea when 2.9.2 will be out? You said next week - I don't suppose there's any chance it could be sooner?

thanks for confirming. [email protected] should be out next week. there are a few other issues that we are tracking as well.

I have a reproducible project where even the latest version of TypeScript available did not work. See https://github.com/TypeStrong/ts-loader/issues/787#issuecomment-395644414

here is the file text:

import { Options } from "./Options";
import { Parent } from "./Parent";

export class Child extends Parent
{
   constructor (name: string)
   {
      super ("1", name, new Options ());
   }
}

So super(new Options()) work, super("", new Options()) does not.

thanks for the repro.

@mhegazy you guys are awesome. Any idea when 2.9.2 will be out?

Original plan is to get it out Wednesday. we are still looking at one final issue. so it could be Thursday. but barring any unforeseen circumstances, it should be out this week.

thanks a ton!

Was this page helpful?
0 / 5 - 0 ratings