Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Typo in require path #326

Closed
Katur7 opened this issue Nov 8, 2016 · 12 comments
Closed

Typo in require path #326

Katur7 opened this issue Nov 8, 2016 · 12 comments
Assignees

Comments

@Katur7
Copy link

Katur7 commented Nov 8, 2016

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

@trkoch
Copy link

trkoch commented Nov 8, 2016

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.

@marcoturi
Copy link
Contributor

Ops, didn't see this issue. Closing #332

@danbucholtz
Copy link
Contributor

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

Thanks,
Dan

@fedesardo
Copy link

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.

@danbucholtz
Copy link
Contributor

@fedesardo,

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

Thanks,
Dan

@jsayol
Copy link

jsayol commented Nov 10, 2016

@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.

@guibson91
Copy link

guibson91 commented Nov 10, 2016

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

@fedesardo
Copy link

Thanks for your answer and workaround ideas!

@danbucholtz
Copy link
Contributor

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

Thanks,
Dan

@guibson91
Copy link

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

@danbucholtz
Copy link
Contributor

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

Thanks,
Dan

@guibson91
Copy link

guibson91 commented Nov 12, 2016

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants