Open tracek opened 7 years ago
@tracek I have a pull-request waiting to be merged that might solve things for you.
The whole build and develop was broken for me too.
You can check out my forked version with the pull request changes in it
@andykenward Thanks! And sorry it took so long for me to answer, I have not noticed your message.
I checked your 'develop' branch and pull request. Short of some warnings that don't look scary, there are still some errors (the same as in the past), namely:
ERROR in ./app/Birds.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./Boilerplate in /home/tracek/Projects/aiexperiments-bird-sounds/app
@ ./app/Birds.js 17:18-42
ERROR in ./app/core/Loader.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../Boilerplate in /home/tracek/Projects/aiexperiments-bird-sounds/app/core
@ ./app/core/Loader.js 17:18-43
ERROR in ./app/core/Filter.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../Boilerplate in /home/tracek/Projects/aiexperiments-bird-sounds/app/core
@ ./app/core/Filter.js 17:18-43
ERROR in ./app/core/ZoomControls.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../Boilerplate in /home/tracek/Projects/aiexperiments-bird-sounds/app/core
@ ./app/core/ZoomControls.js 17:18-43
ERROR in ./app/grid/Grid.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../Boilerplate in /home/tracek/Projects/aiexperiments-bird-sounds/app/grid
@ ./app/grid/Grid.js 17:18-43
ERROR in ./app/core/Label.js
Module not found: Error: Cannot resolve module 'style/label.scss' in /home/tracek/Projects/aiexperiments-bird-sounds/app/core
@ ./app/core/Label.js 17:0-93:2
ERROR in ./app/core/ZoomControls.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../style/ZoomControls.scss in /home/tracek/Projects/aiexperiments-bird-sounds/app/core
@ ./app/core/ZoomControls.js 18:14-54
ERROR in ./app/grid/Dragger.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../Boilerplate in /home/tracek/Projects/aiexperiments-bird-sounds/app/grid
@ ./app/grid/Dragger.js 17:18-43
It is a clean install: npm install && webpack -p
Any advice would be much welcomed! Perhaps a mistake on my side? I am using Xubuntu 16.04.
@tracek I updated README.md with the correct instructions. As running webpack from a global install won't work for everyone with the configuration of how files resolve in this project.
So try running from the root of the project
npm install && npm start
Once you're done the initial npm install
you can just run npm start
each time to run locally.
I am using
@andykenward Thanks for prompt response. Tried that already, but without much luck - errors are the same.
I am pretty sure it is not related to the specific version, as a year ago I was getting exactly the same error. My webpack is installed globally. I tried this on a different machine (although still Ubuntu) and problem was identical.
Solved. I am guessing everyone working on this project are Apple fans :). The reason for the errors is trivial: file names did not match with what's in the code. Example:
var BoilerPlate = require("./Boilerplate");
while the file name is BoilerPlate.js
. Error. I imagine Mac OS (or rather Mac's Node?) is more forgiving when it comes to file name matching.
@tracek Ha! Case sensitive filenames was the only thing I could think it was. I looked through the usage of require for typos and totally missed Boilerplate
to BoilerPlate
.
I even started to add in eslint
instead of jshint
to check the code for me. But you beat me to it.
Personally I always use snake_case for filenames due to this issue happen to me in the past on CI systems and working with multiple developers on different platforms.
But a good code linter setup also catches these things.
@andykenward Thanks again for your help and maintaining the project! I am a total newbie to JS, so for long time I thought it has something to do with the way dependencies are resolved and eventually even started hardcoding file paths. Only then I noticed the issue with case-sensitivity... I am working on building free & open tool for conservation scientists and this project seems like a good inspiration. Large number of labelled records are not easy to come by, so unsupervised methods with some nice user interface are great to have.
[EDIT: I will keep the issue open until it is fixed in the code]
@tracek I would not use this repo as an example of writing JS.
If you are new to JS I suggest learning ES6 JS.
Check out
Thanks, good to know. The project is for me purely of scientific interest, learning ES6 is a side effect.
I see you have been fixing naming in your fork - thanks! Here are two other naming problems:
ERROR in ./app/core/Label.js
Module not found: Error: Cannot resolve module 'style/label.scss' in /home/tracek/Projects/aiexperiments-bird-sounds/app/core
@ ./app/core/Label.js 17:0-93:2
ERROR in ./app/core/ZoomControls.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../../style/ZoomControls.scss in /home/tracek/Projects/aiexperiments-bird-sounds/app/core
@ ./app/core/ZoomControls.js 18:14-54
@tracek Yeah. I started to implement eslint
code linter to catch anymore errors in the code. But this just highlighted even more issues. Bad scoping and coding standards. JS is very forgiving when you run it and the code base does work. So I've just fixed a few more filename and folder issues when require / define
files for now.
There is a resolver in webpack config to app
which then alias whole directory /app
.
It allows you to do
var Data = require("core/Data");
instead of
var Data = require ('../core/Data');
I've removed it, as it wasn't always used in the code base. I also find it confuses people.
Not going to do anymore to the current code base myself. Ideally I would rather refactor the whole repo to ES6 code. But as the owners aren't maintaining it I don't see a point.
It would be great if they just merged my pull request to fix the build for people.
Hi,
I am trying to build your project on xubuntu 16.04 and experience some issues with webpack. Perhaps you could offer some advice here?
npm step goes fine, short of three warning that look rather harmless:
The problems start with webpack:
There are more such errors.
Any tips?