Aaron Ullal
Aaron Ullal

Reputation: 5245

Nativescript ios build fails

I am trying to build my app for iOS but I get this error :

Successfully prepared plugin tns-core-modules for ios.
Processing node_modules failed. TypeError: str.replace is not a function

I don't understand why this only occurs while building for iOS (android works fine). I've already tried adding/removing platforms, updating nativescript etc. Here is my package.json section about running versions

  "nativescript": {
    "id": "com.xxxxx.app",
    "tns-android": {
      "version": "2.4.0"
    },
    "tns-ios": {
      "version": "2.4.0"
    }
  },
  "dependencies": {
    "tns-core-modules": "^2.4.0"
  },

My typescript version is 1.8. What could be the cause of this? Here is my tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "sourceMap": false,
        "experimentalDecorators": true,
        "emitDecoratorMetadata": true,
        "noEmitHelpers": true,
        "noEmitOnError": true
    },
    "exclude": [
        "node_modules",
        "platforms"
    ]
}

Upvotes: 1

Views: 213

Answers (2)

Aaron Ullal
Aaron Ullal

Reputation: 5245

I had to remove the hooks bin and reinstall the ios platform.

Upvotes: 0

hypery2k
hypery2k

Reputation: 1691

maybe you're missing references settings. I've been using NativeScript always with TypeScript 2+. Please checkout this sample app, maybe you'll compare it with your setup: https://github.com/TobiasHennig/nativescript-toast/tree/master/samples/angular

Upvotes: 0

Related Questions