Better know a framework #7 have you tried turning it off and on again

1st rule of IT is - check the cables.
2nd rule of IT is - are there enough disk space on drive C:

3d one would be check the casing (-: that is if you run stuff on linux

here comes the quote from gitter channel

Nick Briscoe @sparkeh9 00:17
I’ve recently been working on a small project using Aurelia and webpack, and I develop on a windows machine. Works and compiles fine, try to run webpack in a build process on a Linux box - breaks with this error, which is entirely meaningless to me, given I don’t know the internals of Aurelia:

TypeError: Cannot read property 'used' of null
    at processDependency (/builds/XXX/node_modules/webpack/lib/FlagDependencyUsagePlugin.js:73:30)
    at processDependenciesBlock (/builds/XXX/node_modules/webpack/lib/FlagDependencyUsagePlugin.js:56:8)

I tried this on my macbook and it built fine like on the windows box .
I decided to check this out manually on a Linux box, I tried webpack with a development build instead, to my surprise the error output was different:

ERROR in ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
Module not found: Error: Can't resolve 'main' in '/builds/XXX/node_modules/aurelia-webpack-plugin/runtime'
 @ ./node_modules/aurelia-webpack-plugin/runtime/empty-entry.js
 @ multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry aurelia-bootstrapper

After a few hours of searching for an answer, it hit me. I noticed it said “Can’t resolve ‘main’”, and using C# all day long I automatically name files in PascalCase.
I renamed Main.ts to main.ts (notice the casing change) and it started to work fine on Linux too .


TL;DR - webpack aurelia bootstrapper expects main.js/main.ts to be lower case - works fine on Windows (obviously due to its case insensitive nature).
I’m still confused as to why it worked on mac to be honest, I always thought it was case sensitive ¯_(ツ)_/¯

2 Likes