Ionic pro build error


#1

Hi! i’m having this error every time i try to build my app in Ionic pro, i did changed only an URL when i pushed my app and suddenly it stopped working, someone knows why or the fix? Thanks!

Running with gitlab-ci-multi-runner 9.1.0 (0118d89)
  on Prod Snapshot Builds 1 (c9648220)
Using Shell executor...
Running on ip-10-2-39-0...
Cloning repository...
Cloning into '/home/gitlab-runner/builds/c9648220/0/project-1'...
Checking out 48b54684 as master...
Skipping Git submodules setup
$ fetch-updates
Checking for build process updates...
$ build-app
Fetching build dependencies...
Running: npm install
npm WARN deprecated cordova-plugin-console@1.1.0: This plugin has been deprecated since it is now included in the latest versions of cordova-ios

> node-sass@4.5.3 install /usr/src/app/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.3/linux-x64-57_binding.node
Download complete
Binary saved to /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Caching binary to /home/gitlab-runner/.npm/node-sass/4.5.3/linux-x64-57_binding.node

> uglifyjs-webpack-plugin@0.4.6 postinstall /usr/src/app/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js


> node-sass@4.5.3 postinstall /usr/src/app/node_modules/node-sass
> node scripts/build.js

Binary found at /usr/src/app/node_modules/node-sass/vendor/linux-x64-57/binding.node
Testing binary
Binary is fine
npm WARN @ionic-native/splash-screen@3.12.1 requires a peer of @ionic-native/core@^3.6.0 but none was installed.
npm WARN @ionic-native/status-bar@3.12.1 requires a peer of @ionic-native/core@^3.6.0 but none was installed.
npm WARN The package @ionic/app-scripts is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 871 packages in 33.204s
npm install succeeded
Running: npm run build
npm info it worked if it ends with ok
npm info using npm@5.3.0
npm info using node@v8.2.1
npm info lifecycle QuickApp@0.0.1~prebuild: QuickApp@0.0.1
npm info lifecycle QuickApp@0.0.1~build: QuickApp@0.0.1

> QuickApp@0.0.1 build /usr/src/app
> ionic-app-scripts build

[20:10:40]  ionic-app-scripts 3.1.0 
[20:10:40]  build dev started ... 
[20:10:40]  clean started ... 
[20:10:40]  clean finished in 1 ms 
[20:10:40]  copy started ... 
[20:10:40]  deeplinks started ... 
[20:10:40]  deeplinks finished in 219 ms 
[20:10:40]  transpile started ... 
[20:10:44]  transpile finished in 3.75 s 
[20:10:44]  preprocess started ... 
[20:10:44]  preprocess finished in less than 1 ms 
[20:10:44]  webpack started ... 
[20:10:44]  copy finished in 4.20 s 
[20:10:51]  ionic-app-script task: "build" 
[20:10:51]  Error: ./src/pages/shopping-list/shopping-list.ts Module parse failed: Unexpected token (278:1099) You may 
            need an appropriate loader to handle this file type. | ShoppingListPage = __decorate([ | Component({ | 
            selector: 
            'page-shopping-list',template:/*ion-inline-start:"/usr/src/app/src/pages/shopping-list/shopping-list.html"*/`\n\n\n \n \n \n \n ShoppingList\n 
            \n\n\n\n\n\n 
{{list.lenght}}

\n 
\n 
you have nothing to show in your shopping list!

\n 
\n \n \n \n \n \n \n \n 
            
{{item.title}}
\n 
${{item.price}}

\n 
{{item.qtty}} articles

\n \n 
            \n \n 
            \n View\n \n \n \n Delete\n \n \n 
            \n \n \n 
\n 
            \n 
Total: 
\n 
${{total}}
\n \n 
\n continue shopping\n Checkout\n\n 
\n\n 
            
\n\n\n\n\n`/*ion-inline-end:"/usr/src/app/src/pages/shopping-list/shopping-list.html"*/, 
            | }), | __metadata("design:paramtypes", [NavController, NavParams, ShoppingListModel, @ 
            ./src/app/app.module.ts 23:0-72 @ ./src/app/main.ts,./src/pages/history/history.ts Module parse failed: 
            Unexpected token (58:1441) You may need an appropriate loader to handle this file type. | HistoryPage = 
            __decorate([ | Component({ | selector: 
            'page-history',template:/*ion-inline-start:"/usr/src/app/src/pages/history/history.html"*/`\n\n\n \n \n 
            \n \n History\n 
            \n\n\n\n\n\n \n \n \n History\n \n \n 
\n \n \n \n \n 
            Date:\n \n {{dates[i]}}\n \n \n \n Store:\n 
            \n {{purchase.store}}\n \n \n \n Total:\n 
            \n ${{purchase.total}}\n \n \n \n \n 
            \n 
\n \n \n 
\n 
You have nothing 
            to show in your history 

\n 
            
\n\n`/*ion-inline-end:"/usr/src/app/src/pages/history/history.html"*/, | }), | 
            __metadata("design:paramtypes", [NavController, NavParams, PurchaseProvider, Storage]) @ 
            ./src/app/app.module.ts 24:0-55 @ ./src/app/main.ts,./src/pages/price-check/price-check.ts Module parse 
            failed: Unexpected token (86:755) You may need an appropriate loader to handle this file type. | 
            PriceCheckPage = __decorate([ | Component({ | selector: 
            'page-price-check',template:/*ion-inline-start:"/usr/src/app/src/pages/price-check/price-check.html"*/`\n\n\n \n Price Check\n 
            \n\n\n\n\n\n \n \n \n {{product.title}}\n \n 
\n {{product.desc}}\n 

\n 
            
${{product.price}}
\n 
Quantity: 

\n 
\n \n 
\n {{qtty}}\n 

\n \n 
\n Add to Shop List\n \n\n \n\n`/*ion-inline-end:"/usr/src/app/src/pages/price-check/price-check.html"*/, | }), | 
            __metadata("design:paramtypes", [NavController, NavParams, ShoppingListModel, Events, FavoritesProvider]) @ 
            ./src/app/app.module.ts 22:0-66 @ ./src/app/main.ts 
Error: ./src/pages/shopping-list/shopping-list.ts
Module parse failed: Unexpected token (278:1099)
You may need an appropriate loader to handle this file type.
| ShoppingListPage = __decorate([
|     Component({
|         selector: 'page-shopping-list',template:/*ion-inline-start:"/usr/src/app/src/pages/shopping-list/shopping-list.html"*/`\n\n\n  \n    \n      \n    \n    ShoppingList\n  \n\n\n\n\n\n  
{{list.lenght}}

\n  
\n    
you have nothing to show in your shopping list!

\n  
\n  \n    \n      \n        \n          \n            \n          \n          
{{item.title}}
\n          
${{item.price}}

\n          
{{item.qtty}} articles

\n        \n        \n          \n            \n            View\n          \n          \n            \n            Delete\n          \n        \n      \n    \n  \n  
\n    \n      
Total: 
\n      
${{total}}
\n    \n    
\n      continue shopping\n      Checkout\n\n    
\n\n  
\n\n\n\n\n`/*ion-inline-end:"/usr/src/app/src/pages/shopping-list/shopping-list.html"*/,
|     }),
|     __metadata("design:paramtypes", [NavController, NavParams, ShoppingListModel,
 @ ./src/app/app.module.ts 23:0-72
 @ ./src/app/main.ts,./src/pages/history/history.ts
Module parse failed: Unexpected token (58:1441)
You may need an appropriate loader to handle this file type.
| HistoryPage = __decorate([
|     Component({
|         selector: 'page-history',template:/*ion-inline-start:"/usr/src/app/src/pages/history/history.html"*/`\n\n\n  \n    \n      \n    \n    History\n  \n\n\n\n\n\n  \n    \n        \n          History\n          \n        \n        
\n          \n            \n              \n                \n                  Date:\n                  \n                    {{dates[i]}}\n                  \n                \n                \n                  Store:\n                  \n                    {{purchase.store}}\n                  \n                \n                \n                  Total:\n                  \n                    ${{purchase.total}}\n                  \n                \n              \n            \n          \n        
\n    \n  \n  
\n    
You have nothing to show in your history 

\n  
\n\n`/*ion-inline-end:"/usr/src/app/src/pages/history/history.html"*/,
|     }),
|     __metadata("design:paramtypes", [NavController, NavParams, PurchaseProvider, Storage])
 @ ./src/app/app.module.ts 24:0-55
 @ ./src/app/main.ts,./src/pages/price-check/price-check.ts
Module parse failed: Unexpected token (86:755)
You may need an appropriate loader to handle this file type.
| PriceCheckPage = __decorate([
|     Component({
|         selector: 'page-price-check',template:/*ion-inline-start:"/usr/src/app/src/pages/price-check/price-check.html"*/`\n\n\n  \n    Price Check\n  \n\n\n\n\n\n    \n      \n        \n          {{product.title}}\n        \n        
\n          {{product.desc}}\n        

\n        
${{product.price}}
\n        
Quantity: 

\n        
\n          \n          
\n            {{qtty}}\n          

\n          \n        
\n        Add to Shop List\n        \n\n        \n\n`/*ion-inline-end:"/usr/src/app/src/pages/price-check/price-check.html"*/,
|     }),
|     __metadata("design:paramtypes", [NavController, NavParams, ShoppingListModel, Events, FavoritesProvider])
 @ ./src/app/app.module.ts 22:0-66
 @ ./src/app/main.ts
    at new BuildError (/usr/src/app/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at callback (/usr/src/app/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
    at emitRecords.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/usr/src/app/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/usr/src/app/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/usr/src/app/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/usr/src/app/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/usr/src/app/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/usr/src/app/node_modules/webpack/lib/Compiler.js:365:9)
npm info lifecycle QuickApp@0.0.1~build: Failed to exec build script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! QuickApp@0.0.1 build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the QuickApp@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gitlab-runner/.npm/_logs/2017-11-10T20_10_51_798Z-debug.log
npm run build failed
Make sure your project has a build script in the package.json
Running after script...
$ clean-up
Cleaning up files...
Successful clean up
ERROR: Job failed: exit status 1

#2

There are already several posts about this. The solution that worked for me was modifying my package.json file and changing all of the version numbers of of any @ionic-native plugins to 4.3.3


#3

it didn’t worked for me :confused:


#4

I went to the github ionic issues and found the solution to my problem, it was when I combined $ and {{ in the HTML binding. Thank for your help!