RC2 build dev failed: Cannot find module '../util/Logger'


#1

I updated to RC2, updated the package.json, deleted the node_modules and did a npm install. When I run ionic serve it is throwing an error.

build dev failed: Cannot find module ‘…/util/Logger’

I suspect it is because of new IonicErrorHandler but does anyone know what is missing?

  "dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.2",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.41",
    "typescript": "^2.0.3"
  },

#2

Ok, I went back to "@ionic/app-scripts": "0.0.39" and it seems to work fine. Must be a problem in the newer build scripts.

I just reset the devDependencies in package.json to:

"devDependencies": {
    "@ionic/app-scripts": "0.0.39",
    "typescript": "^2.0.3"
  },

Deleted the node_modules and did a npm install and it works. Also make sure you have done a

npm install -g ionic

to make sure you have the latest version


#3

hi i have the same problem now with Cannot find module ./util/Logger
What exactly is the solution to it.
thanks a lot :slight_smile:


#4

This worked, thanks!


#5

Interesting, we haven’t seen this error at all with 0.0.39.
Are you sure it’s just not a bad npm install?
We’ve tested windows and osx without any issues.


#6

I have the same error build dev failed: Cannot find module ‘…/util/Logger’ after upgrading to app-scripts 0.0.42 (& RC2)
deleting and re-installing node modules didn’t fix.
All fine with RC2 and 0.0.39,


#7

It’s a typo in app-scripts that only affects case-sensitive filesystems.


#8

http://blog.ionic.io/?utm_source=framework&utm_medium=navbar&utm_campaign=blog%20CTA&_ga=1.38119392.236218355.1477266658


#9

It might just be a problem with 0.0.41. I’m running in on Ubuntu 16.04. I test it with 0.0.39 and it works fine too.


#10

Thanks, I’m running Ubuntu 16.04 with is case-sensitive but I would expect that that would also affect OSX users too.


#11

It is still present in 0.0.42 (Ubuntu).

As pointed by @rapropos it can be solved editing:

node_modules/@ionic/app-scripts/dist/webpack/ionic-environment-plugin.js

and modifying in line 2 (notice the L to l):

'../util/Logger' ->> '../util/logger'

See https://github.com/driftyco/ionic-app-scripts/issues/326#issuecomment-259623619


#12

Eits a problem only with …0.42, it works fine downwards


#13

This is fixed in 0.0.43.


#14

confirmed, 0.0.43 fixed the problem!