question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

brunch build fails with Error: Improperly-cased require: on Windows Linux Subsystem

See original GitHub issue

Description

brunch build fails with the exception: “Error: Improperly-cased require” on Windows Linux Subsystem ubuntu shell when the source files are on the auto-mounted Windows host file system.

Expected behavior

From a ubuntu bash shell, brunch build should succeed.

Actual behavior

From a ubuntu bash shell, brunch build results in: error: Processing of app/initialize.js failed. Error: Improperly-cased require: ‘./logger’ in /mnt/c/users/tim/dev/ubdev/proj/app/initialize.js

If the source files are within the ubuntu linux file system the build is successful, however Microsoft strongly recommends using the auto-mounted windows file system for source code, it is on this mounted file system that the error occurs.

How to re-produce

From a windows file system mount point within a ubuntu bash shell, follow the “Getting Started” guide. http://brunch.io/docs/getting-started

Exception happens after including require(‘./logger’) in initialize.js Zip file of brunch generated project attached. proj.zip

Environment

  1. Brunch: 2.10.12
  2. Node.js: v8.10.0
  3. NPM: 3.5.2
  4. Operating system: Ubuntu via Windows Linux Subsystem
  5. Code editor: visual studio code

package.json contents

{
  "name": "brunch-app",
  "description": "Brunch.io application",
  "private": true,
  "author": "Brunch",
  "version": "0.0.1",
  "repository": "",
  "scripts": {
    "start": "brunch watch --server",
    "build": "brunch build --production"
  },
  "dependencies": {
    "jquery": "^3.3.1"
  },
  "devDependencies": {
    "auto-reload-brunch": "^2",
    "babel-brunch": "~6.0",
    "babel-preset-latest": "^6",
    "brunch": "^2",
    "clean-css-brunch": "^2",
    "uglify-js-brunch": "^2"
  }
}

brunch config contents

exports.files = {
  javascripts: {
    joinTo: {
      'vendor.js': /^(?!app)/, // Files that are not in `app` dir.
      'app.js': /^app/
    }
  },
  stylesheets: {joinTo: 'app.css'}
};

exports.plugins = {
  babel: {presets: ['latest']}
};

Other useful files, when present (log, bower.json etc.)

19:27:34 - error: Processing of app/initialize.js failed. Error: Improperly-cased require: ‘./logger’ in /mnt/c/users/tim/dev/ubdev/proj/app/initialize.js at checkImproperCase (/mnt/c/users/tim/dev/ubdev/proj/node_modules/deppack/lib/resolve.js:77:15) at browserResolve (/mnt/c/users/tim/dev/ubdev/proj/node_modules/deppack/lib/resolve.js:95:7) at /mnt/c/users/tim/dev/ubdev/proj/node_modules/browser-resolve/index.js:269:13 at onfile (/mnt/c/users/tim/dev/ubdev/proj/node_modules/resolve/lib/async.js:51:21) at onex (/mnt/c/users/tim/dev/ubdev/proj/node_modules/resolve/lib/async.js:93:22) at /mnt/c/users/tim/dev/ubdev/proj/node_modules/resolve/lib/async.js:24:18 at FSReqWrap.oncomplete (fs.js:153:5)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
frobergcommented, Sep 6, 2018

I had a problem with Improperly-cased for my phoenix javascript files on a new project. It took some time but I finally realised that my current path in the Ubuntu terminal was /mnt/c/Projects… instead of the actual path /mnt/c/projects….

I guess as unix is case insensitive you are allowed to go to a directory using capital letters even though it should be lowercase but it then caused problem for brunch.

Maybe that can help someone. /c

0reactions
FVolralcommented, Apr 22, 2019

I had a very similar issue using Cygwin and fish shell and I understood how it happened in my case. The path to my project folder contains few upper and lower cases. For instance :

/cygdrive/c/My_projects/FOO/my_project

but when I’m typing my cd commands to reach the folder using fish shell, fish allows me to do this :

cd cygdrive/c/my_projects/foo/my_project

It works, I mean fish will not complain if I do that but for brunch it seems that the path is now wrong. brunch config doesn’t matter in my case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Windows Subsystem for Linux | Microsoft Learn
Provides detailed information about common errors and issues people run into while running Linux on the Windows Subsystem for Linux.
Read more >
Windows subsystem for Linux - Microsoft Community
I get the error message " WslRegisterDistribution failed with error: ... The Windows Subsystem for Linux optional component is not enabled.
Read more >
Windows Subsystem for Linux Update - 5.10.93.2 failed to ...
it says that windows update tries to install arm64 package for x64 system and that gives error. I am trying the solution at...
Read more >
FAQ's about Windows Subsystem for Linux - WSL
Find answers to frequently asked questions (FAQs) about the Windows Subsystem for Linux, such as 'What can I do with WSL?'.
Read more >
How to: Enable the Windows Subsystem for Linux - Microsoft ...
Although this article does not focus on UNIX, it discusses a close cousin to the UNIX operating system, Linux. At the 2016 Build...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found