This project is read-only. to my imported modules are private??

Topics: General
Dec 6, 2012 at 11:56 AM
Edited Dec 6, 2012 at 5:20 PM

I just upgraded from TypeScript to and all of a sudden all my ts files have errors like


property 'MyProperty' of exported interface has or is using private type 'MyModule'

exported interface 'MyInterface; extends interface from private module 'MyModule'

exported class's constructor parameter 'myParameter' has or is using private type 'MyModule'

public function parameter 'myParameter' has or is using private type 'MyModule'

public member 'myMember' of exported class has or is using private type 'MyModule'


where MyModule refers to the identifier of an imported module like so:

import MyModule = module("MyModule");

this was not a problem with TypeScript I have no idea how to fix it. Can anybody help please?


Dec 6, 2012 at 1:53 PM

Had this problem as well, ended up downgrading until someone posts an answer

Dec 6, 2012 at 3:09 PM

In the instances I've seen of this, it means what it says;-) Your exporting module exports an item, but not its type/interface, so the importing module can refer to the item, but not to its type/interface. Usually, you'll want to export the type/interface as well.

Dec 6, 2012 at 5:10 PM

The issue is as follows:

file ModuleA.ts:

export interface InterfaceA{

file ModuleB.ts:

import ModuleA = module("ModuleA");

export interface InterfaceB extends ModuleA.InterfaceA{

With TypeScript this generates an error in file ModuleB.ts saying exported interface InterfaceB extends interface from private module ModuleA. With TypeScript this does not generate an error.

Dec 6, 2012 at 8:07 PM

I would also add that this worked in It's that adds the additional check. I haven't come up with a solution yet so I'll probably have to downgrade for now if no solution is found.

Dec 6, 2012 at 8:12 PM

I figured it out. You can actually export your imports:

export import MyModule = module('MyModule');

export class MyClass extends MyModule.MyBaseClass {

Dec 6, 2012 at 8:13 PM


Dec 6, 2012 at 8:34 PM

well done! That does the trick. I never would have guessed that.

Dec 11, 2012 at 6:19 PM

This is popping up on a few threads.  It looks like this was a bug introduced in  

Imports should "just work" without having to do anything extra to be able to use and extend them.  You shouldn't have to re-export your imports just to use them.

Additionally, being able to re-export imports sounds like something that probably shouldn't be allowed.

Dec 11, 2012 at 7:16 PM

Glad to hear that. I've been avoiding because of this and am glad I didn't go and export all of my imports. please ;-)