Ionic3 build Error - upgrading from ionic2 to ioni3

You don’t need that any more. If your code still uses it, update to the new @ionic-native.

I did as per your instructions @Sujan12, now I am getting this error below. [19:11:30] build prod started ... [19:11:30] clean started ... [19:11:30] clean finished in 8 ms [19:11:30] copy started ... [19:11:30] ngc started ... [19:11:54] ngc finished in 23.80 s [19:11:54] preprocess started ... [19:11:54] deeplinks started ... [19:11:56] deeplinks finished in 1.94 s [19:11:56] optimization started ... [19:11:59] copy finished in 28.69 s [19:12:22] optimization finished in 25.84 s [19:12:22] preprocess finished in 27.78 s [19:12:22] webpack started ... [19:14:55] webpack finished in 153.16 s [19:14:55] sass started ... [19:14:55] uglifyjs started ... [19:15:01] sass finished in 6.56 s [19:15:01] cleancss started ... [WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date. Error: Cannot set property 'fixed' of undefined in undefined at line undefined, col undefined, pos undefined

I updated the @ionic-native plugin too before getting this output…

Thanks,
Anup

Give us your new ionic info output in the project.
Also run the same command that gives you the error with --verbose at the end.

Hi @Sujan12,

Glad to see your support, thanks.

This is my project’s ionic info

global packages:

    @ionic/cli-plugin-proxy : 1.3.1
    @ionic/cli-utils        : 1.4.0
    Cordova CLI             : 6.5.0
    Ionic CLI               : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.4.0

System:

    Node       : v6.9.5
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 5.0.3

and I also did run the command with --verbose at the end and this is the output :

[DEBUG] Error: Cannot set property 'fixed' of undefined in undefined at line undefined,  col undefined, pos undefined  at BuildError.Error (native)  at new BuildError
		(D:\app\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
        at taskReject
        (D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:36:22)
        at
        D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:14:13  at process._tickCallback (internal/process/next_tick.js:103:7)

Cheers,
Anup

Ah, now we got it: Ionic (or better app-scripts) is not yet ready for npm5 really.

If you ionic start blank blank a new project for example you would get an error about node-sass something. Downgrade your npm (possibly by downgrading node, best use nvm-windows so you can switch between node version effortlessly in the future) and try again.

Hi @Sujan12,

I did the changes as per your comments.
I have also installed nvm-windows which is of a great help.

When i tried to run the project after downgrading the npm i got this error :

PS D:\app> ionic cordova run android --prod --verbose
ERR: Your Node.js version is v5.0.0. Please update to the latest Node 6 LTS version (or latest Node).

I am really stuck up now.

The recommended Node 6 LTS (currently v6.11.0) has npm 3.10.10 which should work fine.

Yes i did make the required changes but still the error persists.

This is my ionic info for now :

global packages:

    @ionic/cli-plugin-proxy : 1.3.1
    @ionic/cli-utils        : 1.4.0
    Cordova CLI             : 6.5.0
    Ionic CLI               : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.4.0

System:

    Node       : v6.11.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 5.0.3

and this is the error again :

      date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Cannot set property 'fixed' of undefined in undefined at line undefined, col undefined, pos undefined
[DEBUG] Error: Cannot set property 'fixed' of undefined in undefined at line undefined, col undefined, pos undefined
       at BuildError.Error (native)
       at new BuildError
       (D:\app\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
       at taskReject
       (D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:36:22)
       at
       D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:14:13
       at process._tickCallback (internal/process/next_tick.js:109:7)
   	```

You are still on npm5. New installs of node 6.11.0 include npm 3.10.10: Download | Node.js

Latest LTS Version: v6.11.0 (includes npm 3.10.10)

I did update it too. Still the same.

[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Cannot set property 'fixed' of undefined in undefined at line undefined, col undefined, pos undefined
[DEBUG] Error: Cannot set property 'fixed' of undefined in undefined at line undefined, col undefined, pos undefined
        at BuildError.Error (native)
        at new BuildError
        (D:\app\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
        at taskReject
        (D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:36:22)
        at
        D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:14:13
        at process._tickCallback (internal/process/next_tick.js:109:7)

PS D:\app> ionic info

global packages:

    @ionic/cli-plugin-proxy : 1.3.1
    @ionic/cli-utils        : 1.4.0
    Cordova CLI             : 6.5.0
    Ionic CLI               : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.4.0

System:

    Node       : v6.11.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 3.10.10

Delete node_modules and run npm install now.

Appreciate your patience, but again I am failing with npm install now.

PS D:\app> npm install
Error: Cannot find module 'safe-buffer'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\Deep\AppData\Roaming\npm\node_modules\npm\node_modules\request\lib\helpers.js:5:36)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Deep\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code MODULE_NOT_FOUND

npm ERR! Cannot find module 'safe-buffer'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

Ok, that means that your npm install is broken I think. npm install -g maybe (don’t know if this exists) or reinstall node/npm again. Something is broken there. (See e.g. https://github.com/npm/npm/issues/16905)

Yes I was able to fix that npm issue, now I tried building the project and faced the same issue again.

[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
[DEBUG] !!! ERROR ENCOUNTERED !!!
Error: Cannot set property 'fixed' of undefined in undefined at line undefined, col undefined, pos undefined
[DEBUG] Error: Cannot set property 'fixed' of undefined in undefined at line undefined, col undefined, pos undefined
        at BuildError.Error (native)
        at new BuildError
        (D:\app\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
        at taskReject
        (D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:36:22)
        at
        D:\app\node_modules\@ionic\app-scripts\dist\worker-process.js:14:13
        at process._tickCallback (internal/process/next_tick.js:109:7)

Anything else which I need to do please let me know. I can start fresh if you want me to, with the current project in ionic2 to port to ionic3.

Thanks for your support.

What command exactly are you executing right now?

Please create a new blank project with ionic start blank blank and execute the same command there. Do you get the same error?

@Sujan12, I am using ionic cordova run android --prod --verbose

as you said the new project with ionic start blank blank is working fine with the commands you mentioned and in the current system environment.

Ok, I am officially out of ideas. Something is breaking the build for your project, but I have no idea what it is and how you could debug this further.

  1. ionic cordova run android --verbose works without problems, correct?
  2. The only remaining hint is the almost useless error message: Search for “fixed” in your code, comment that stuff out, try again.

Well, ok, even I tried to remove “fixed” keyword , but ended with same result.

My request to you would be, please let me know if there is any official link which says how to port ionic2 projects to ionic3. So that i can follow step by step process and build the app. I will try to start fresh and re-do flow again.

Nothing “official”, but here is a topic that includes the relevant bits: Guide: How to update to Ionic 3.X

Sure, I will work on this and let you know.

1 Like