title: error TS2339: Property 'finally' does not exist on type 'Promise<void>'
body: <p>I am working on enhancing my Login component by using some JHipster generated services, but I've encountered a problem.</p>
  
  <p>I am getting <code>error TS2339: Property 'finally' does not exist on type 'Promise&lt;void&gt;'.</code> when I try to submit the login form.</p>
  
  <p>Here is the code which generates error: <strong>login.component.ts</strong> </p>
  
  <pre><code>login() {
      if (this.validate(this.form)) {
          this.loginService
              .login({
                  username: this.model.username,
                  password: this.model.password,
              })
              .then(() =&gt; {
                  this.redirectUser();
              })
              .catch(() =&gt; {
                  this.authNoticeService.setNotice('The username or password is incorrect', 'error');
              })
              .finally(() =&gt; {
                  this.spinner.active = false;
                  this.actionChange.next( this.action );
              });
      }
  }
  </code></pre>
  
  <p><strong>login.service.ts</strong></p>
  
  <pre><code>login(credentials, callback?) {
      const cb = callback || function() {};
  
      return new Promise((resolve, reject) =&gt; {
          this.authServerProvider.login(credentials).subscribe(
              data =&gt; {
                  this.principal.identity(true).then(account =&gt; {
                      // After the login the language will be changed to
                      // the language selected by the user during his registration
                      if (account !== null) {
                          this.languageService.changeLanguage(account.langKey);
                      }
                      resolve(data);
                  });
                  return cb();
              },
              err =&gt; {
                  this.logout();
                  reject(err);
                  return cb(err);
              }
          );
      });
  }
  </code></pre>
  
  <p>I've tried to add returning type of login method from <code>login.service.ts</code> like that:</p>
  
  <pre><code>login(credentials, callback?):Promise&lt;any&gt; {
  </code></pre>
  
  <p>But without any success.</p>
  
  <p>I've done some research and according to this: <a href="https://stackoverflow.com/a/52098456/9026582">https://stackoverflow.com/a/52098456/9026582</a> the problem should be resolved with <code>typescript: 2.7.0</code>.<br>
  I have <code>typescript: 2.7.2</code> version, so I guess that it is not the case.</p>
  
  <p>Maybe the problem is connected to callbacks in <code>login(credentials, callback?)</code> method?</p>
  
  <p><strong>EDIT: original tsconfig.json configuration</strong>  </p>
  
  <p><strong>tsconfig.json</strong></p>
  
  <pre><code>{
    "compileOnSave": false,
    "compilerOptions": {
      "outDir": "./dist/out-tsc",
      "sourceMap": true,
      "declaration": false,
      "moduleResolution": "node",
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "allowSyntheticDefaultImports": true,
      "target": "es5",
      "typeRoots": [
        "./node_modules/@types"
      ],
      "lib": [
        "es2017",
        "dom"
      ]
    }
  }
  </code></pre>
  
  <p><strong>tsconfig.app.json</strong></p>
  
  <pre><code>{
    "extends": "../tsconfig.json",
    "compilerOptions": {
      "outDir": "../out-tsc/app",
      "baseUrl": "./",
      "module": "es2015",
      "types": []
    },
    "exclude": [
      "test.ts",
      "**/*.spec.ts"
    ]
  }
  </code></pre>