NativeScript / nativescript-dev-webpack

A package to help with webpacking NativeScript apps.
Apache License 2.0
97 stars 49 forks source link

Error is: Unexpected token < in JSON at position 641. #825

Closed tahir-jamil closed 5 years ago

tahir-jamil commented 5 years ago

Application crashes on uglify with webpack

Package.json

{
  "name": "tu-shared-app",
  "nativescript": {
    "id": "org.nativescript.tusharedapp",
    "tns-ios": {
      "version": "5.1.1"
    },
    "tns-android": {
      "version": "5.1.0"
    }
  },
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "android": "tns run android --bundle",
    "ios": "tns run ios --bundle"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0-beta.5",
    "@angular/animations": "^7.0.4",
    "@angular/cdk": "^7.2.0",
    "@angular/common": "~7.0.0",
    "@angular/compiler": "~7.0.0",
    "@angular/core": "~7.0.0",
    "@angular/flex-layout": "^7.0.0-beta.22",
    "@angular/forms": "~7.0.0",
    "@angular/http": "~7.0.0",
    "@angular/material": "^7.2.0",
    "@angular/platform-browser": "~7.0.0",
    "@angular/platform-browser-dynamic": "~7.0.0",
    "@angular/router": "~7.0.0",
    "@ng-bootstrap/ng-bootstrap": "^4.0.1",
    "@ng-select/ng-select": "^2.15.0",
    "@types/color": "^3.0.0",
    "ag-grid-angular": "^19.1.2",
    "ag-grid-community": "^19.1.4",
    "bootstrap": "4.2.1",
    "color": "^3.1.0",
    "core-js": "^2.5.4",
    "google-libphonenumber": "^3.2.2",
    "intl-tel-input": "^14.0.10",
    "js-data": "^3.0.5",
    "js-data-http": "^3.0.1",
    "lodash.filter": "^4.6.0",
    "lodash.get": "^4.4.2",
    "lodash.remove": "^4.7.0",
    "lodash.uniqby": "^4.7.0",
    "nativescript-angular": "~7.0.0",
    "nativescript-checkbox": "^3.0.3",
    "nativescript-email": "^1.5.3",
    "nativescript-fresco": "^5.1.0",
    "nativescript-geolocation": "^4.4.2",
    "nativescript-google-maps-sdk": "^2.6.1",
    "nativescript-google-places-autocomplete": "^1.0.3",
    "nativescript-localstorage": "^2.0.0",
    "nativescript-ng-shadow": "^2.1.0",
    "nativescript-pager": "^9.3.8",
    "nativescript-performance-monitor": "^1.0.0",
    "nativescript-phone": "^1.3.1",
    "nativescript-platform-css": "^1.6.6",
    "nativescript-scaledfonts": "file:nativescript-scaledfonts",
    "nativescript-telephony": "^1.0.4",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-ui-chart": "^3.9.0",
    "nativescript-ui-dataform": "^3.7.2",
    "nativescript-ui-gauge": "^3.7.1",
    "nativescript-ui-listview": "^5.0.1",
    "ng-click-outside": "^4.0.0",
    "ng-connection-service": "^1.0.4",
    "ngx-bootstrap": "^3.2.0",
    "ngx-intl-tel-input": "^2.0.7",
    "ngx-perfect-scrollbar": "^7.1.0",
    "reflect-metadata": "~0.1.8",
    "rxjs": "^6.2.0",
    "tns-core-modules": "~5.0.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.8.0",
    "@angular/cli": "^7.0.0",
    "@angular/compiler-cli": "~7.0.0",
    "@nativescript/schematics": "~0.3.0",
    "@types/googlemaps": "^3.30.16",
    "@types/jasmine": "2.8.11",
    "@types/jasminewd2": "~2.0.3",
    "@types/lodash": "^4.14.119",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "nativescript-dev-sass": "~1.6.0",
    "nativescript-dev-typescript": "~0.7.0",
    "nativescript-dev-webpack": "^0.17.0",
    "protractor": "~5.3.0",
    "tns-platform-declarations": "^5.1.1",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~3.1.1"
  }
}

tsconfig.json

{
"compileOnSave": false,
"compilerOptions": {
"outDir": "./dist/out-tsc",
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es6",
"skipLibCheck": true,
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom",
"es6",
"es2015.iterable"
],
"baseUrl": "src",
"paths": {
"@tu/*": ["app/*"],
"~/*": [
"./*"
],
// "~/*": [
//     "app/*"
// ],
"*": [
"./node_modules/tns-core-modules/*",
"./node_modules/*"
]
}
},
"exclude": [
"**/*.tns.ts",
"**/*.android.ts",
"**/*.ios.ts",
"**/*.spec.ts"
]
}
NickIliev commented 5 years ago
            // "~/*": [
            //     "app/*"
            // ],

The default rule is that comments are not allowed in JSON files. Remove the commented part from your tsconfig.json (and from any other JSON files)