Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • Sign in / Register
Minds Frontend
Minds Frontend
  • Project overview
  • Repository
  • Issues 381
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 58
  • CI / CD
  • Security & Compliance
  • Packages
  • Analytics
  • Wiki
  • Snippets
  • Members
  • Collapse sidebar
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Minds
  • Minds FrontendMinds Frontend
  • Issues
  • #2510

Closed
Open
Opened 5 days ago by Narayanan KA@movingisliving2019
Report abuse New issue

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.

Linked issues
0

  • Discussion 6
  • Designs 0
  • Ben Hayward
    Ben Hayward @benhayward.ben · 5 days ago
    Developer

    Please see https://developers.minds.com/docs/guides/frontend/

  • Ben Hayward @benhayward.ben closed 5 days ago

    closed

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 4 days ago

    Thanks a lot @benhayward.ben

  • Narayanan KA @movingisliving2019 reopened 3 days ago

    reopened

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 3 days ago

    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), inside php-fpm container from var/www/Minds/front, the same directory in nginxcontainer, as well as the dist and en folders. Inside php-fpm i got the error ENOENT: no such file or directory, open '/var/www/Minds/front/package.json' where as in minds-master/front I got the error missing 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 error Cannot 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 3 days ago
  • Ben Hayward
    Ben Hayward @benhayward.ben · 3 days ago
    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.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 2 days ago

    Thanks @benhayward.ben , will try it out.

  • Narayanan KA
    Narayanan KA @movingisliving2019 · 10 hours ago

    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 6 hours ago
Please register or sign in to reply
0 Assignees
None
none
Epic
None
None
Milestone
None
Time tracking
No estimate or time spent
None
Due date
None
0
Labels
None
None
Weight
None
Confidentiality
Not confidential
Lock issue
Unlocked
2
2 participants
user avatar
user avatar
Reference: minds/front#2510