JohnVonNeumann / opensorcery

Gamified open source contributions.
7 stars 0 forks source link

Frontend container webpack issue on startup #37

Closed Samseppiol closed 5 years ago

Samseppiol commented 5 years ago

When running 'make up', at container runtime the frontend container fails to start with the following error.


frontend_1  | > frontend@1.0.0 dev /code/frontend
frontend_1  | > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 0.0.0.0
frontend_1  |
frontend_1  | sh: webpack-dev-server: not found
frontend_1  | npm ERR! file sh
frontend_1  | npm ERR! code ELIFECYCLE
frontend_1  | npm ERR! errno ENOENT
frontend_1  | npm ERR! syscall spawn
frontend_1  | npm ERR! frontend@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js --host 0.0.0.0`
frontend_1  | npm ERR! spawn ENOENT
frontend_1  | npm ERR!
frontend_1  | npm ERR! Failed at the frontend@1.0.0 dev script.
frontend_1  | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
frontend_1  | npm WARN Local package.json exists, but node_modules missing, did you mean to install?
frontend_1  |
frontend_1  | npm ERR! A complete log of this run can be found in:
frontend_1  | npm ERR!     /root/.npm/_logs/2019-04-14T02_43_01_951Z-debug.log
opensorcery_frontend_1 exited with code 1 
JohnVonNeumann commented 5 years ago
Local package.json exists, but node_modules missing, did you mean to install?

I've never had this issue in development, I'm assuming because I'm individually installing packages as I go I must be explicitly calling the npm install that it needs, it'll be a missing command in one of the docker related files. I'll patch this ASAP. Cheers!

EDIT: For context, https://github.com/angular/quickstart/issues/420

JohnVonNeumann commented 5 years ago

@Samseppiol Can you run docker-compose up --build for me from the root directory? I think it's an issue with the make up command, because make up will up bring the cluster up, it won't build the containers as well.

Samseppiol commented 5 years ago

@JohnVonNeumann Does not work either, seems to be something to do with how node modules are being handled. Funnily enough if I shell into the container and run the same command npm run dev then I do not get this issue

JohnVonNeumann commented 5 years ago

@Samseppiol So don't quote me on this, but I think this issue is a symptom of a bad docker setup created by me, I'm working on a ticket at the moment that is seeing issues around this, so I'll be having to fix this fairly soon in the natural progression of work. I think basically it's an issue around my use of individual dockerfiles, combined with docker-compose. I'm referencing/overwriting volumes and it's acting weird (acting as intended from the docker side of things, my mental model of how it works is what is broken).

JohnVonNeumann commented 5 years ago

Can you please pull master and let me know if this is still an issue? Some changes have been made over the last few days and I'm struggling to replicate now. @Samseppiol

JohnVonNeumann commented 5 years ago

I think this may have been fixed with #41

JohnVonNeumann commented 5 years ago

Fixed by #43