How to solve the “module has no exported member” error?

Remove the line below from your statement

export module Demo

and use it like

export class ViewModel {
    constructor(public test: string) {
    }
}

Edit: For namespace, just do something like

namespace Demo {
  export class ViewModel {
        constructor(public test: string) {
        }
    }
}

Leave a Comment