Edits in the angular code not reflected in the local installation
As an beginner in Angular, I wanted to try making some small changes to the minds front-end (local host), but no matter what changes i make to the HTML files in src/app/..
the changes are not being reflected on my local install of minds, even after performing sync-engine and sync-front. Changes to the PHP files in engine seems to work well when using this methodology. I have tried clearing the browser cache as well.
Is there a different method/process to making changes in the front end ?
I have tried renaming Discovery, adding small HTML codes in app.component.html
, etc. The changes are not reflected in the browser on reloading. I even tried adding a comment, but couldn't find it in inspect. Previously i had tried a direct ng serve from front folder, didn't work out, so I realised the entire minds website needs to be loaded on localhost.
@benhayward.ben , Please, a little bit of guidance here if possible.
- Developer
closed
Thanks a lot @benhayward.ben
reopened
Hi @benhayward.ben , I tried following what was written in the guide and got stuck at the very first step. I couldn't figure out where to run the command
npm run server:dev
. I tried running it from multiple locations, namely the front folder in minds-master (from which I run docker-compose), insidephp-fpm
container fromvar/www/Minds/front
, the same directory innginx
container, as well as thedist
anden
folders. Inside php-fpm i got the errorENOENT: no such file or directory, open '/var/www/Minds/front/package.json'
where as inminds-master/front
I got the errormissing script: server:dev
. Am I running the command in the wrong directory ?Edit: I checked the package.json file and here is how it looks:
"name": "v5.x", "version": "0.0.0", "license": "MIT", "scripts": { "ng": "ng", "start": "ng serve", "preinstall": "git config core.hooksPath .git/hooks/", "prebuild": "gulp build.sass", "build": "ng build --prod", "prebuild-dev": "gulp build.sass --deploy-url=http://localhost/en", "build-dev": "ng build --output-path dist/en --deploy-url=/en/ --watch=true --poll=800", "test": "ng test", "lint": "ng lint", "e2e": "cypress run --debug", "e2e-open": "cypress open", "postinstall": "node patch.js" }
So I tried running
npm run build-dev
, I am getting the errorCannot find module 'gulp-cli'
, despite global installing gulp-cli. Also I have tried changing--deploy-url=http://localhost/en
to--deploy-url=http://<my.domain.name>/en
to no effect.Edit 2: I directly ran the command
ng serve --host=0.0.0.0 --deploy-url=/ --poll=800 --progress --disableHostCheck=true
from minds-master\front and although it worked as intended in the cmd, the website itself didn't show any of the changes even after clearing cache.Edited by Narayanan KA- Developer
We're moving to SSR so depending on your branch you may not have that option. Here's my personal start script
#!/bin/bash # cd /home/nemo/work/minds/ echo 'optional params: jit, serve, aot - defaults to serve' echo 'starting the stack' docker-compose up -d nginx runners sockets # Dev only env settings to keep ES from locking up at low memory. # curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_cluster/settings -d '{ "transient": { "cluster.routing.allocation.disk.threshold_enabled": false } }' # curl -XPUT -H "Content-Type: application/json" http://localhost:9200/_all/_settings -d '{"index.blocks.read_only_allow_delete": null}' echo 'running front end build process' cd front if [[ $1 == 'serve' ]] then echo 'serving' npm run serve-dev elif [[ $1 == 'jit' ]] then echo 'running JIT build process' npm run build-dev elif [[ $1 == 'aot' ]] then echo 'running AOT build process' NODE_OPTIONS=--max_old_space_size=4096 npm run build-dev -- --aot=true --optimization=false else echo 'running default serve' npm run serve:dev fi
You can call it start.sh,
chmod + x
on it and run it as:./start.sh aot
./start.sh jit
./start.sh serve
Play around one of them should work.
Thanks @benhayward.ben , will try it out.
Hi @benhayward.ben , considering my branch is outdated, I tried installing the latest version available on gitlab, on my windows localhost. Currently getting this error when i do
docker-compose down
build path E:\MindsFeb\minds\front\dist either does not exist, is not accessible, or is not a valid URL.
It seems to work fine for the older branch(oct-2019) that I was previously using. I also tried downgrading my docker-compose version to 1.17 (from 1.24), to no effect. I also couldn't find any issue similar to mine in gitlab. Is it a problem with docker windows and the latest minds version specifically ?
Edited by Narayanan KA