# Ionic 2 beta45 - ReferenceError: Zone is not defined

**URL:** <https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824>\
**Category:** ionic-v3\
**Created:** [December 23, 2015, 3:38pm UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824 "2015-12-23T15:38:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamespaxi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jamespaxi/32/64917_2.png) [@jamespaxi](https://forum.ionicframework.com/u/jamespaxi)\
**Post date:** [December 23, 2015, 3:38pm UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/1 "2015-12-23T15:38:32Z")

</div>

Hi chaps,

updated to Ionic2-beta44 and Angular2-beta0.

Getting this error on a fresh install:

> ReferenceError: Zone is not defined

Could it be that the angular2-polyfills.js file is not being included somewhere in the dependencies?

Anyone stubmled on this problem? 😄 Thanks chaps!

---

<div class="post-metadata">

**Author:** ![luchillo17](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/luchillo17/32/78209_2.png) [@luchillo17](https://forum.ionicframework.com/u/luchillo17)\
**Post date:** [December 23, 2015, 4:32pm UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/2 "2015-12-23T16:32:19Z")

</div>

2 things:

1. Ionic 2 current version is alpha.45, CLI is beta.15
2. Can you put your package.json, ionic.config.js, webpack.config.js in pastebin to debug?

---

<div class="post-metadata">

**Author:** ![jamespaxi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jamespaxi/32/64917_2.png) [@jamespaxi](https://forum.ionicframework.com/u/jamespaxi)\
**Post date:** [December 23, 2015, 4:41pm UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/3 "2015-12-23T16:41:24Z")

</div>

Thanks for the interest!  
Ok, Just updated everything to latest as suggested.

I’m going through everything again, looks like the TypeScript version of the starter app is not ready yet.

[https://github.com/driftyco/ionic2-starter-tabs/tree/typescript](https://github.com/driftyco/ionic2-starter-tabs/tree/typescript)

I’m copying the configs across and moved the “app” folder out of “www”.

* * *

This is my latest achievement 😄

> GET [http://localhost:8100/app/app.html](http://localhost:8100/app/app.html) 404 (Not Found)

Guess there is something I’ve missed.

---

<div class="post-metadata">

**Author:** ![jamespaxi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jamespaxi/32/64917_2.png) [@jamespaxi](https://forum.ionicframework.com/u/jamespaxi)\
**Post date:** [December 23, 2015, 4:47pm UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/4 "2015-12-23T16:47:16Z")

</div>

package.json

```
{
  "dependencies": {
    "angular2": "2.0.0-beta.0",
    "es6-promise": "3.0.2",
    "es6-shim": "0.33.13",
    "ionic-framework": "2.0.0-alpha.45",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "zone.js": "0.5.10"
  },
  "devDependencies": {
    "awesome-typescript-loader": "^0.15.9",
    "strip-sourcemap-loader": "0.0.1",
    "typescript": "^1.7.3"
  },
  "name": "ionic2-test",
  "description": "ionic2-test: An Ionic project"
}

```

webpack.config.js

```
var path = require('path');

module.exports = {
  entry: [
    path.normalize('es6-shim/es6-shim.min'),
    'reflect-metadata',
    'web-animations.min',
    path.normalize('zone.js/dist/zone-microtask'),
    path.resolve('app/app')
  ],
  output: {
    path: path.resolve('www/build/js'),
    filename: 'app.bundle.js',
    pathinfo: false // show module paths in the bundle, handy for debugging
  },
  module: {
    loaders: [
      {
        test: /\.ts$/,
        loader: 'awesome-typescript',
        query: {
          'doTypeCheck': false
        },
        include: path.resolve('app'),
        exclude: /node_modules/
      },
      {
        test: /\.js$/,
        include: path.resolve('node_modules/angular2'),
        loader: 'strip-sourcemap'
      }
    ],
    noParse: [
      /es6-shim/,
      /reflect-metadata/,
      /web-animations/,
      /zone\.js(\/|\\)dist(\/|\\)zone-microtask/
    ]
  },
  resolve: {
    alias: {
      'web-animations.min': path.normalize('ionic-framework/js/web-animations.min')
    },
    extensions: ["", ".js", ".ts"]
  }
};

```

ionic.config.js

```
module.exports = {
  proxies: null,

  paths: {
    html : {
      src: ['app/**/*.html'],
      dest: "www/build"
    },
    sass: {
      src: ['app/app.+(ios|md).scss'],
      dest: 'www/build/css',
      include: ['node_modules/ionic-framework']
    },
    fonts: {
      src: ['node_modules/ionic-framework/fonts/**/*.ttf'],
      dest: "www/build/fonts"
    },
    watch: {
      sass: ['app/**/*.scss'],
      html: ['app/**/*.html'],
      livereload: [
        'www/build/**/*.html',
        'www/build/**/*.js',
        'www/build/**/*.css'
      ]
    }
  },

  autoPrefixerOptions: {
    browsers: [
      'last 2 versions',
      'iOS >= 7',
      'Android >= 4',
      'Explorer >= 10',
      'ExplorerMobile >= 11'
    ],
    cascade: false
  },

  // hooks execute before or after all project-related Ionic commands
  // (so not for start, docs, but serve, run, etc.) and take in the arguments
  // passed to the command as a parameter
  //
  // The format is 'before' or 'after' + commandName (uppercased)
  // ex: beforeServe, afterRun, beforePrepare, etc.
  hooks: {
    beforeServe: function(argv) {
      //console.log('beforeServe');
    }
  }
};
```

---

<div class="post-metadata">

**Author:** ![icarus\_31](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/icarus_31/32/94713_2.png) [@icarus\_31](https://forum.ionicframework.com/u/icarus_31)\
**Post date:** [December 24, 2015, 12:47am UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/5 "2015-12-24T00:47:57Z")

</div>

I have the same issue here since I upgraded the CLI and framework ☹

I am also using TS

---

<div class="post-metadata">

**Author:** ![icarus\_31](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/icarus_31/32/94713_2.png) [@icarus\_31](https://forum.ionicframework.com/u/icarus_31)\
**Post date:** [December 24, 2015, 1:14am UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/6 "2015-12-24T01:14:00Z")

</div>

Hey @jamespaxi, here what I did to fix the Zone issue

webpack.config.js

```
var path = require('path');
var paths = require('./ionic.config').paths;

module.exports = {
  entry: [
    'es6-shim/es6-shim.min',
    'reflect-metadata',
    'web-animations.min',
    path.normalize('zone.js/dist/zone-microtask'),//'zone.js',
    path.join(__dirname, paths.wwwDir, paths.appDir, paths.appSrcModule)
  ],
output: {
    path: path.join(__dirname, paths.wwwDir, paths.buildDir, paths.buildJSDir),
    filename: paths.appBuildBundle,
    publicPath: path.join(paths.buildDir, paths.buildJSDir),
    pathinfo: false // show module paths in the bundle, handy for debugging
},
module: {
   loaders: [
    {
      test: /\.ts$/,
      loader: 'awesome-typescript',
      query: {
        'doTypeCheck': false
      },
      include: [path.join(__dirname, paths.wwwDir)],
      exclude: /node_modules/
    },
    {
      test: /\.js$/,
      include: /node_modules\/angular2/,
      loader: 'strip-sourcemap'
    }
  ]
},
resolve: {
  alias: {
    'web-animations.min': 'ionic-framework/js/web-animations.min',
  },
  extensions: ["", ".js", ".ts"]
}
};
```

---

<div class="post-metadata">

**Author:** ![icarus\_31](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/icarus_31/32/94713_2.png) [@icarus\_31](https://forum.ionicframework.com/u/icarus_31)\
**Post date:** [December 27, 2015, 2:33pm UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/7 "2015-12-27T14:33:18Z")

</div>

Another suggestion is to create a new ionic 2 project and use the new released webpack.

---

<div class="post-metadata">

**Author:** ![jamespaxi](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/jamespaxi/32/64917_2.png) [@jamespaxi](https://forum.ionicframework.com/u/jamespaxi)\
**Post date:** [December 27, 2015, 6:53pm UTC](https://forum.ionicframework.com/t/ionic-2-beta45-referenceerror-zone-is-not-defined/39824/8 "2015-12-27T18:53:56Z")

</div>

Thanks @icarus_31!

I’ve managed to sort it finally fixing the last few files the other day. Great help!

I’ll check the new released version with webpack. Kudos!
