Ionic build error Cannot find module './scheduler/Action'

reymon359

So I have been developing an ionic app and when I build it I got this error . Here is the full code of the image.

PS D:\MEGA\proyectos\ionic\6- gag2> ionic cordova build android
> ionic-app-scripts build --target cordova --platform android
[20:45:31]  ionic-app-scripts 3.2.0
[20:45:31]  build dev started ...
[20:45:31]  clean started ...
[20:45:31]  clean finished in 32 ms
[20:45:31]  copy started ...
[20:45:31]  deeplinks started ...
[20:45:31]  deeplinks finished in 32 ms
[20:45:31]  transpile started ...
[20:45:36]  typescript: D:/MEGA/proyectos/ionic/6- gag2/node_modules/rxjs/Scheduler.d.ts, line: 1
            Cannot find module './scheduler/Action'.


       L1:  import { Action } from './scheduler/Action';
       L2:  import { Subscription } from './Subscription';

[20:45:36]  ionic-app-script task: "build"
[20:45:36]  Error: Failed to transpile program
Error: Failed to transpile program
    at new BuildError (D:\MEGA\proyectos\ionic\6- gag2\node_modules\@ionic\app-scripts\dist\util\errors.js:16:28)
    at D:\MEGA\proyectos\ionic\6- gag2\node_modules\@ionic\app-scripts\dist\transpile.js:159:20
    at new Promise (<anonymous>)
    at transpileWorker (D:\MEGA\proyectos\ionic\6- gag2\node_modules\@ionic\app-scripts\dist\transpile.js:107:12)
    at Object.transpile (D:\MEGA\proyectos\ionic\6- gag2\node_modules\@ionic\app-scripts\dist\transpile.js:64:12)
    at D:\MEGA\proyectos\ionic\6- gag2\node_modules\@ionic\app-scripts\dist\build.js:109:82
    at <anonymous>
[ERROR] An error occurred while running subprocess ionic-app-scripts.

        ionic-app-scripts build --target cordova --platform android exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

It seems like i am missing the scheduler/Action module from my node_modules. I searched for an answer and got a solution, well a temporary one, by doing:

npm install rxjs@^6.0.0 --save

and then:

npm install --save rxjs-compat

By executing these commands I can build my app. But after some builds the error comes back and i have to re-execute those 2 comands.

here is a log whit some warnings that i get after the comands

I think the problem comes from a recently update I made a day ago. I tried to update angular, angularCLI and the rxjs but i think i made something wrong.

Here is the package.json of my app with the versions of the dependences

{
  "name": "gag2",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/camera": "^4.16.0",
    "@ionic-native/core": "~4.15.0",
    "@ionic-native/image-picker": "^4.16.0",
    "@ionic-native/splash-screen": "~4.15.0",
    "@ionic-native/status-bar": "~4.15.0",
    "@ionic/pro": "2.0.3",
    "@ionic/storage": "2.2.0",
    "angularfire2": "^5.0.2",
    "cordova-android": "7.1.1",
    "cordova-plugin-camera": "4.0.3",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.2.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-telerik-imagepicker": "2.2.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "firebase": "^5.5.5",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "promise-polyfill": "^8.1.0",
    "rxjs": "^6.0.0",
    "rxjs-compat": "^6.3.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.0",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-camera": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-telerik-imagepicker": {
        "PHOTO_LIBRARY_USAGE_DESCRIPTION": "your usage message"
      }
    },
    "platforms": [
      "android"
    ]
  }
}

I would like to know how to solve the module problem. I think I have to update correctly my angular and rxjs or install some angular and rxjs dependeces but I simply dont know where to start and don't want to mess my app more.

reymon359

After all this day working around a solution, I reinstaled properly angular and cli to the latest version

npm install -g @angular/cli@latest

and after that executed this comand too

npm i rxjs@6 rxjs-compat@6 promise-polyfill --save

This made the problem before disappear.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Ionic 2 - Runtime error Cannot find module "."

Ionic => Runtime error: Cannot find module "."

Ionic build cannot find module error. How to import Android plugin?

Runtime Error Cannot find module "ionic-native" IONIC 2

ionic cordova build android Cannot find module '../pages/Wallet/'

Ionic 3: Build in “prod” mode: Cannot find module “.”

Ionic Cordova Build prod: Cannot find module “.” - Typescript version >3

Module build failed: Error: Cannot find module 'node-sass'

Error: Cannot find module '/app/__sapper__/build' on Cloud Build

Error: "Cannot find module" when cloning Ionic 4 component with StencilJS

Ionic Uncaught Error: Cannot find module "." when importing a service provider

Error: Cannot find module '@ionic/app-scripts'

Error: Cannot find module "rxjs/operators" in Ionic Angular

Ionic3 - Uncaught Error: Cannot find module '.'

Error: Cannot find module 'symbol-observable' in Ionic 4

Cordova 4.3.0 - build command returns error Cannot find module 'Q'

Error: Cannot find module '../build/Release/bson' on Mac

Error: Cannot find module './'

ng build cannot find module

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'build\app' imported from build\server.js

error TS2307: Cannot find module '@ionic-native/date-picker/ngx' in ionic 4

IONIC 2 - Runtime Error. Cannot find module “ionic-native”

ERROR in ./src/styles.scss .. Module build failed: Error: Cannot find module 'node-sass'

Ionic 4 / Angular Routing: ERROR Error: Uncaught (in promise): Error: Cannot find 'EventHomePageModule' in './home/home.module'

webpacker Uncaught Error: Module build failed / Cannot find module 'babel-plugin-syntax-dynamic-import'

Rocket.Chat build failing with error "Cannot find module '../build/Release/sharp.node' "

Dynamic Environment Variables in Ionic - Cannot find module

Cannot find module generated with “Ionic g provider”

Ionic 2 cannot find module 'dgram'