Ionic-app-scripts: Typo in require path

Created on 8 Nov 2016  路  12Comments  路  Source: ionic-team/ionic-app-scripts

Short description of the problem:

Webpack build fails with this error: build dev failed: Cannot find module '../util/Logger'

What behavior are you expecting?

In dist/webpack/ionic-environment-plugin.js
var Logger_1 = require('../util/Logger');
should be:
var Logger_1 = require('../util/logger');
(notice the lowercase l)

Steps to reproduce:

  1. Start new project
  2. Run ionic serve

Which @ionic/app-scripts version are you using?
0.0.41

Most helpful comment

@fedesardo If you need to get it fixed right now before a new version is published, go to the root of your project and edit the file at node_modules/@ionic/app-scripts/dist/webpack/ionic-environment-plugin.js. Change line number 2 from

var Logger_1 = require('../util/Logger');

to

var Logger_1 = require('../util/logger');

Don't forget to update @ionic/app-scripts to the latest version as soon as it's published!

Edit: Like Dan said, install the latest @ionic/app-scripts as this has already been resolved.

All 12 comments

This is an especially mean typo because it breaks builds on case-sensitive file systems (e.g. most Linux), but works on case-insensitive systems (e.g. some macOS). My workaround is to symlink Logger.js to logger.js but obviously this should be fixed upstream.

Ops, didn't see this issue. Closing https://github.com/driftyco/ionic-app-scripts/issues/332

@marcoturi had a PR merged for this. This must have been a VSCode autocorrect or something. Not sure. Sorry!

Thanks,
Dan

Hello guys! Sorry about this question but I am new in this world! How can I update ionic to fix this issue? I tried with npm install -g ionic, ionic lib update (ups, lot of warning related to use a deprecated command).

Thanks in advance.

@fedesardo,

We haven't published a fix yet but probably will today (Thursday).

Thanks,
Dan

@fedesardo If you need to get it fixed right now before a new version is published, go to the root of your project and edit the file at node_modules/@ionic/app-scripts/dist/webpack/ionic-environment-plugin.js. Change line number 2 from

var Logger_1 = require('../util/Logger');

to

var Logger_1 = require('../util/logger');

Don't forget to update @ionic/app-scripts to the latest version as soon as it's published!

Edit: Like Dan said, install the latest @ionic/app-scripts as this has already been resolved.

Thanks, @jsayol !!! This resolved the problem!!

Thanks for your answer and workaround ideas!

This is resolved. Please install npm install @ionic/app-scripts@latest.

Thanks,
Dan

In Linux Mint, I need change local variable "logger" yet, even updating lasted script.

@guibson91, I'm not following what you mean. Can you explain what you changed?

Thanks,
Dan

I deleted the node_modules folder, ran the "npm install @ionic/app-scripts@latest" command, but I kept getting error messages because of "Util / Logger".
When I renamed the variable:

Var Logger_1 = require ( '../ util / Logger');

to

Var Logger_1 = require ( '../ util / logger');

In file "node_modules/@ionic/app-scripts/dist/webpack/ionic-environment-plugin.js" solved the problem.

My OS is Linux Mint 18, which the terminal is case sensitive.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hermitdemschoenenleben picture hermitdemschoenenleben  路  3Comments

itryan picture itryan  路  3Comments

nalkon picture nalkon  路  4Comments

dbarrecoquel picture dbarrecoquel  路  3Comments

azakusilo picture azakusilo  路  4Comments