Ionic dependencies issues, main.css missing, ios won't build

Hi, I was doing project dependencies update to use all the latest version, but now I run into some issues.
If I do ionic serve, app starts but everithing is messed up.
Terminal log

[INFO] Starting app-scripts server: --port 8100 --p 8100 --livereload-port 35729 --r 35729 --address 0.0.0.0 - Ctrl+C to
cancel
[13:36:25] watch started …
[13:36:25] build dev started …
[13:36:25] clean started …
[13:36:25] clean finished in 4 ms
[13:36:25] copy started …
[13:36:25] transpile started …
[13:36:30] transpile finished in 4.67 s
[13:36:30] preprocess started …
[13:36:30] deeplinks started …
[13:36:30] deeplinks finished in 122 ms
[13:36:30] preprocess finished in 123 ms
[13:36:30] webpack started …
[13:36:30] copy finished in 5.08 s
[13:36:50] webpack finished in 19.79 s
[13:36:50] sass started …
Your current PostCSS version is 5.2.17, but autoprefixer uses 6.0.8. Perhaps this is the source of the error below.
[13:36:52] dev server running: http://localhost:8100/

[INFO] Development server running
Local: http://localhost:8100

[13:36:53] watch ready in 27.72 s

And in console log from the browser I get

Failed to load resource: the server responded with a status of 404 (Not Found) main.css

And if I try to do a build for iOS it won’t even build the app

ionic cordova build ios

I get

Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[13:41:32] build dev started …
[13:41:32] clean started …
[13:41:32] clean finished in 5 ms
[13:41:32] copy started …
[13:41:32] transpile started …
[13:41:37] transpile finished in 4.81 s
[13:41:37] preprocess started …
[13:41:37] deeplinks started …
[13:41:37] deeplinks finished in 143 ms
[13:41:37] preprocess finished in 144 ms
[13:41:37] webpack started …
[13:41:37] copy finished in 5.28 s
[13:41:56] webpack finished in 19.41 s
[13:41:56] sass started …
Your current PostCSS version is 5.2.17, but autoprefixer uses 6.0.8. Perhaps this is the source of the error below.
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
date.
TypeError: Path must be a string. Received undefined

System settings

global packages:

@ionic/cli-utils : 1.5.0
Cordova CLI      : 7.0.1 
Ionic CLI        : 3.5.0

local packages:

@ionic/app-scripts              : 2.0.2
@ionic/cli-plugin-cordova       : 1.4.1
@ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms               : android 6.1.0 ios 4.3.1
Ionic Framework                 : ionic-angular 3.5.3

System:

Node       : v6.9.5
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 
ios-deploy : not installed
ios-sim    : not installed
npm        : 4.1.2

UPDATE 2: browserslist@2.2.2 fixes the bug. Just upgrade it (npm install browserlist@2.2.2) or delete node_modules folder and re-run npm install.

UPDATE: Downgrading app-scripts isn’t enought, because produces vendor.js error.

The problem is in browserslist@2.2.1 (pull request is waiting for merge the fix), then downgrading it to 2.2.0 fixed the vendor.js and the main.css problems.

npm install browserslist@2.2.0

It’s because an issue with the app-scripts version and dependencies.

Downgrade it to v1.3.7 fixed the problem to me.

npm install @ionic/app-scripts@1.3.7 --save-dev

You could see the issue here:

https://github.com/ionic-team/ionic/issues/12442
https://github.com/ionic-team/ionic/issues/12441

1 Like