Ionic-cli: Error: Metadata emit requires the sourceFiles are passed to WriteFileCallback

Created on 15 Nov 2016  路  7Comments  路  Source: ionic-team/ionic-cli

Note: for support questions, please use one of these channels:

https://forum.ionicframework.com/
http://ionicworldwide.herokuapp.com/

Note: for build related issues you can open up an issue on the ionic-app-scripts repo

https://github.com/driftyco/ionic-app-scripts

Short description of the problem:

I'm getting

Error: Metadata emit requires the sourceFiles are passed to WriteFileCallback. Update to TypeScript ^1.9.0-dev

when trying to build an Ionic 2 project for iOS. Using typescript 2.0.9. Tried reverting to older versions including 1.9.0-dev and 1.8 but get same error. Also have npm updated all packages.

What behavior are you expecting?

Build with no errors

Steps to reproduce:

  1. Build ionic 2 project for iOS
  2. ngc barfs
insert any relevant code between the above and below backticks

Post the output of ionic info below please
Your system information:

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.1
Ionic App Lib Version: 2.1.1
Ionic App Scripts Version: 0.0.36
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X Sierra
Node Version: v6.8.1
Xcode version: Xcode 8.1 Build version 8T61a

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Suggestion to revert typescript version. Doesn't work for me: https://github.com/mgechev/angular2-ngc-rollup-build/issues/2

old major version

Most helpful comment

Was running into the same issue as above after updating my projects dependencies with npm update. I had "typescript": "^2.0.6" in my devDependencies and it updated to 2.1.1.
Changed "typescript": "^2.0.6" to "typescript": "2.0.6" (note the caret), ran npm install and the bug disappeared.

All 7 comments

Same problem here..

Was running into the same issue as above after updating my projects dependencies with npm update. I had "typescript": "^2.0.6" in my devDependencies and it updated to 2.1.1.
Changed "typescript": "^2.0.6" to "typescript": "2.0.6" (note the caret), ran npm install and the bug disappeared.

@vjanssens your workaround worked well for me, thanks :)

I just had the same problem using typescript 2.1.1, installed 2.0.10 and it worked... I suppose that ngc doesn't support TS 2.1.x yet

same here, I changed to TS 2.0.6 and now it works, thanks @vjanssens

I'd really love to make it work with TS 2.1 as it supports async/await transpilation to ES5. Is there a workaround?

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings