brunch build fails with Error: Improperly-cased require: on Windows Linux Subsystem
See original GitHub issueDescription
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
- Brunch: 2.10.12
- Node.js: v8.10.0
- NPM: 3.5.2
- Operating system: Ubuntu via Windows Linux Subsystem
- 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:
- Created 5 years ago
- Comments:5
Top GitHub Comments
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
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.