Ionic-cli: Cannot re-export name that is not defined in the module.

Created on 18 Mar 2016  ยท  10Comments  ยท  Source: ionic-team/ionic-cli

_From @fairsayan on March 18, 2016 12:8_

Short description of the problem:

I just created a new project in Ionic 2 typescript and sidemenu as template
Everytime I run ionic serve I receive this not blocking error:

ERROR in [default] /.../scaffold-ionic/node_modules/angular2/src/facade/promise.d.ts:1:9
Cannot re-export name that is not defined in the module.

Steps to reproduce:

  1. ionic start scaffold-ionic sidemenu --v2 --ts
  2. ionic serve

Here the complete flow

โˆ† 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: 4d8afbdec4626d5a657f
Version: webpack 1.12.11
Time: 5935ms
Asset Size Chunks Chunk Names
app.bundle.js 2.73 MB 0 [emitted] main
[0] multi main 64 bytes {0} [built]
+ 363 hidden modules

ERROR in [default] /.../scaffold-ionic/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
โˆš Running dev server: 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 $

_Copied from original issue: driftyco/ionic#5876_

Most helpful comment

Add this line below at the top of promise.d.ts to declare the Promise variable will fix the problem:
declare var Promise: PromiseConstructor;

All 10 comments

Thanks for opening this issue with us! As this issue has more to do with our CLI than the actual framework I will be moving this issue over to that repo. Please feel free to continue the conversation there! Thanks again!

Add this line below at the top of promise.d.ts to declare the Promise variable will fix the problem:
declare var Promise: PromiseConstructor;

Is this an issue related with ionic or angular2? What is the best way to have this fix included in the core (without the necessity to manually add this line everytime I create a new project)?

angular2 module

I also encounter this issue today.
But in addition to the fix mentioned by @MrBokeh in the promise.d.ts file, I also had to add this on top of my gulpfile.js : require('es6-promise').polyfill();

Edit: I forget to mention that I init my project with --sass flag : ionic start ion2 tutorial --v2 --ts --sass

Hi !

I have the same issue, however there is no promise.d.ts file on my side, how is this possible ? :-/
I used the ionic start --v2 --ts command.

My bad, updating promise.d.ts file worked for me. :+1:

Where I should add declare var Promise: PromiseConstructor;?

@GaneshPediredla as described by @MrBokeh : at the top of promise.d.ts

yes got it. But every project i should do like this. Its bit difficult to for every project. Any otherway to solve this problem permanently?

yes its working:)

Was this page helpful?
0 / 5 - 0 ratings