Webpack build fails with this error: build dev failed: Cannot find module '../util/Logger'
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:
Which @ionic/app-scripts version are you using?
0.0.41
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!
@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.
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 atnode_modules/@ionic/app-scripts/dist/webpack/ionic-environment-plugin.js. Change line number 2 fromvar Logger_1 = require('../util/Logger');tovar Logger_1 = require('../util/logger');Don't forget to update@ionic/app-scriptsto the latest version as soon as it's published!Edit: Like Dan said, install the latest
@ionic/app-scriptsas this has already been resolved.