# Some errors in ionic2 serve, but the app works at all

**URL:** <https://forum.ionicframework.com/t/some-errors-in-ionic2-serve-but-the-app-works-at-all/46576>\
**Category:** ionic-v3\
**Created:** [March 16, 2016, 11:09am UTC](https://forum.ionicframework.com/t/some-errors-in-ionic2-serve-but-the-app-works-at-all/46576 "2016-03-16T11:09:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aluknot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aluknot/32/92447_2.png) [@aluknot](https://forum.ionicframework.com/u/aluknot)\
**Post date:** [March 16, 2016, 11:09am UTC](https://forum.ionicframework.com/t/some-errors-in-ionic2-serve-but-the-app-works-at-all/46576/1 "2016-03-16T11:09:57Z")

</div>

I don’t know if i am doing something wrong in my code or the errors are wrong but i am getting this while i do ionic serve:

> C:\Users\Next-Version\Desktop\rrpp2\>ionic serve

> ∆ Compiling and bundling with Webpack…  
> √ Using your webpack.config.js file

> ∆ Compiling Sass to CSS  
> √ Matching patterns: app/theme/app.+(ios|md|wp).scss

> ∆ Copying fonts  
> √ Matching patterns: node\_modules/ionic-angular/fonts/\*\*/\*.+(ttf|woff|woff2)

> ∆ Copying HTML  
> √ Matching patterns: app/\*\*/\*.html

> √ HTML copied to www/build  
> √ Sass compilation complete  
> √ Fonts copied to www/build/fonts

> Hash: 603e3ac45ed7bb0c9ca9  
> Version: webpack 1.12.11  
> Time: 18707ms  
> Asset Size Chunks Chunk Names  
> app.bundle.js 2.73 MB 0 [emitted] main  
> [0] multi main 64 bytes {0} [built]  
> + 364 hidden modules

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/app.ts:27:13  
> Property ‘app’ does not exist on type ‘MyApp’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/app.ts:28:13  
> Property ‘menu’ does not exist on type ‘MyApp’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/app.ts:30:13  
> Property ‘pages’ does not exist on type ‘MyApp’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/app.ts:56:13  
> Property ‘menu’ does not exist on type ‘MyApp’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/app.ts:60:23  
> Property ‘app’ does not exist on type ‘MyApp’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/detail/detail.ts:9:13  
> Property ‘nav’ does not exist on type ‘DetailPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/detail/detail.ts:10:13  
> Property ‘params’ does not exist on type ‘DetailPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/detail/detail.ts:15:24  
> Property ‘params’ does not exist on type ‘DetailPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/detail/detail.ts:16:13  
> Property ‘user’ does not exist on type ‘DetailPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/home/home.ts:9:13  
> Property ‘nav’ does not exist on type ‘HomePage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/home/home.ts:10:13  
> Property ‘menu’ does not exist on type ‘HomePage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/home/home.ts:14:13  
> Property ‘menu’ does not exist on type ‘HomePage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/home/home.ts:15:25  
> Property ‘menu’ does not exist on type ‘HomePage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/home/home.ts:19:13  
> Property ‘nav’ does not exist on type ‘HomePage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/list/list.ts:11:13  
> Property ‘nav’ does not exist on type ‘ListPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/list/list.ts:12:13  
> Property ‘http’ does not exist on type ‘ListPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/list/list.ts:17:13  
> Property ‘http’ does not exist on type ‘ListPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/list/list.ts:18:17  
> Property ‘users’ does not exist on type ‘ListPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/list/list.ts:19:29  
> Property ‘users’ does not exist on type ‘ListPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/app/pages/list/list.ts:26:13  
> Property ‘nav’ does not exist on type ‘ListPage’.

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/node\_modules/angular2/src/facade/promise.d.ts:1:9  
> Cannot re-export name that is not defined in the module.

> √ Webpack complete

> ∆ Starting dev server.

> √ Running live reload server: [http://localhost:35729](http://localhost:35729)  
> √ Running dev server: [http://localhost:8100](http://localhost:8100)  
> √ Watching: 0=www/build/ **/\*.html, 1=www/build/** /_.js, 2=www/build/\*\*/_.css  
> Ionic server commands, enter:  
> restart or r to restart the client app from the root  
> goto or g and a url to have the app navigate to the given url  
> consolelogs or c to enable/disable console log output  
> serverlogs or s to enable/disable server log output  
> quit or q to shutdown the server and exit

> ionic $

The app is working perfect, but the errors persists. Here is my **list.ts** for example:

```
import {Page, NavController} from 'ionic-angular';
import {Http} from 'angular2/http';
import {DetailPage} from '../detail/detail';

@Page({
  templateUrl: 'build/pages/list/list.html',
})
export class ListPage {

    constructor(nav : NavController, http : Http) {
        this.nav = nav;
        this.http = http;
        this.reqApi();
    }
    
    reqApi() {
        this.http.get("http://api.randomuser.me/?results=20&nat=es").subscribe(data => {
            this.users = data.json().results;
            console.log(this.users);
    }, error => {
            console.log(error);
        });
    }
    
    goDetailPage(user) {
        this.nav.push(DetailPage, {user: user});
    }
}

```

I am doing something wrong or what?

Thanks

---

<div class="post-metadata">

**Author:** ![iignatov](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/iignatov/32/100112_2.png) [@iignatov](https://forum.ionicframework.com/u/iignatov)\
**Post date:** [March 16, 2016, 11:51am UTC](https://forum.ionicframework.com/t/some-errors-in-ionic2-serve-but-the-app-works-at-all/46576/2 "2016-03-16T11:51:02Z")

</div>

AFAIK, in TypeScript you should declare the members of the class before using them.

Either explicitly:

```auto
export class ListPage {
    private nav: NavController; // <- Declare the property explicitly as private.
    http: Http; // Declare the property explicitly (the access defaults to public).

    constructor(nav: NavController, http: Http) {
        this.nav = nav;
        this.http = http;
        this.reqApi();
    }

```

Or implicitly:

```auto
export class ListPage {
    // Implicit declaration of private/public members in the constructor.
    constructor(private nav: NavController, public http: Http) {
        // this.nav = nav; <- This is not needed anymore.
        // this.http = http;
        this.reqApi();
    }

```

---

<div class="post-metadata">

**Author:** ![aluknot](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aluknot/32/92447_2.png) [@aluknot](https://forum.ionicframework.com/u/aluknot)\
**Post date:** [March 16, 2016, 12:04pm UTC](https://forum.ionicframework.com/t/some-errors-in-ionic2-serve-but-the-app-works-at-all/46576/4 "2016-03-16T12:04:30Z")

</div>

Thanks @iignatov maybe i should read more about typescript. The errors are solved, except this:

> ERROR in [default] C:/Users/Next-Version/Desktop/rrpp2/node\_modules/angular2/src/facade/promise.d.ts:1:9  
> Cannot re-export name that is not defined in the module.

What this mean? Thanks

---

<div class="post-metadata">

**Author:** ![iignatov](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/iignatov/32/100112_2.png) [@iignatov](https://forum.ionicframework.com/u/iignatov)\
**Post date:** [March 16, 2016, 12:27pm UTC](https://forum.ionicframework.com/t/some-errors-in-ionic2-serve-but-the-app-works-at-all/46576/5 "2016-03-16T12:27:57Z")

</div>

This error is caused by incompatibility between TypeScript and Angular _(see [angular issue #6468](https://github.com/angular/angular/issues/6468), **tl;dr:** TypeScript 1.8 requires angular2 beta.7 or higher)_. Check in your `package.json` file which version of TypeScript is used _(most probably 1.8+)_. This error will be resolved with the next Ionic2 release (`beta.4`) because the `master` is already updated to Angular2 `beta.8`.

The TypeScript syntax is a bit more verbose than JS but offers some nice features.

I’ll recommend you to start with this article: [Top 10 Things to Know about TypeScript](http://www.developer.com/lang/top-10-things-to-know-about-typescript.html).
