i tried installation of erpnext v14 in local host using native installation (non-docker) method
it works fine in development mode
$ bench start
after CTRL+C
i tried to run it in production mode
i.e bench start in backend
it works in browser but the css and assets are not loading properly
try to fix it by
$ bench build
$ bench build --production
$ bench --site mysite.erp clear-website-cache
but nothing works to fix the issue , any tip to resolve the issue
smino
May 8, 2023, 1:07pm
2
Hi,
What installation method was used? What commands were used to setup production?
avc
May 8, 2023, 1:27pm
3
Hi:
Seems due to permissions on your bench folder.
Check your /var/log/nginx/error.log
Anything related?
Hope this helps.
$ sudo apt update -y
$ sudo adduser frappe
$ sudo usermod -aG sudo frappe
$ su frappe
$ cd /home/frappe/
$ sudo apt-get install git python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils python3.10-venv software-properties-common mariadb-server mariadb-client redis-server xvfb libfontconfig wkhtmltopdf libmysqlclient-dev curl nginx supervisor fail2ban -y
$ sudo systemctl start nginx && sudo systemctl enable nginx
$ sudo systemctl start supervisor && sudo systemctl enable supervisor
$ sudo systemctl start fail2ban && sudo systemctl enable nginx
$ sudo systemctl status nginx
$ sudo systemctl status supervisor
$ sudo systemctl status fail2ban
$ sudo mysql_secure_installation
$ sudo vim /etc/mysql/my.cnf
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
:wq!
$ sudo service mysql restart
$ sudo systemctl restart mariadb.service
$ sudo systemctl enable mariadb.service
$ sudo curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
$ source ~/.profile
$ nvm install 16.15.0
$ sudo apt-get install npm
$ sudo npm install -g yarn
$ sudo npm install -g yarn
$ node --version
$ sudo pip3 install frappe-bench
$ bench --version
$ bench init frappe-bench
$ cd frappe-bench/
$ chmod -R o+rx /home/frappe
$ bench new-site zha.erp
MySQL root password: ********
Set Administrator password: ********
Re-enter Administrator password: ********
$ bench --site zha.erp add-to-hosts
$ bench --site zha.erp enable-scheduler
$ bench --site zha.erp set-maintenance-mode off
$ sudo bench setup production frappe --yes
$ sudo systemctl reload nginx
$ bench setup nginx
$ sudo supervisorctl restart all
$ sudo bench setup production frappe
$ sudo systemctl reload nginx
http://zha.erp:8000
i give the permissions as
$ chmod -R o+rx /home/frappe
and the logs are
$ sudo tail -f error.log
2023/05/08 19:18:27 [notice] 5533#5533: using inherited sockets from "6;7;"
2023/05/08 20:18:59 [notice] 5416#5416: signal process started
2023/05/08 20:19:12 [notice] 5423#5423: signal process started
2023/05/08 20:20:03 [notice] 5456#5456: signal process started
2023/05/08 20:20:18 [notice] 5509#5509: signal process started
2023/05/08 20:21:46 [notice] 6372#6372: signal process started
2023/05/08 20:24:54 [notice] 7330#7330: signal process started
2 Likes
smino
May 8, 2023, 6:37pm
6
Has bench build completed without error after setup production?
bench build --production
runs fine without any error
For v14
Add this in your hooks.py app_include_css = "your_app.bundle.css"
Then create a file in your app module public/scss/your_app.bundle.scss
In your_app.bundle.scss file write @import './app.scss';
In this public/scss directory(where your_app.buldle.scss file located) create your custom scss file.
then run bench build --your_app
Hopefully that will work
2 Likes
I got it working after doing a reinstall. I am using docker to run frappe. But it does the same thing not loading the css and assets maybe after updating the docker image.
imbra
March 18, 2024, 3:37pm
11
If you are getting this:
Run
bench setup requirements
bench build
bench clear-cache
bench clear-website-cache
2 Likes
Im used this but it not work for me.
bench build
bench build --production
bench --site mysite.erp clear-website-cache
sudo chmod -R o+rx /home/frappe
but still it wont work for me . can anyone help me with this issue.
avc
August 16, 2024, 11:35am
14
Hi @Sumith-2004 :
Check your browser console. Any errors there?
And also im checked Console β CSS . its log is given below:
Download the Vue Devtools extension for a better development experience: GitHub - vuejs/devtools: βοΈ Browser devtools extension for debugging Vue.js applications. vue.esm.js:9122:10
You are running Vue in development mode. Make sure to turn on production mode when deploying for production. See more tips at Production Deployment β Vue.js vue.esm.js:9133:8
Selector expected. Ruleset ignored due to bad selector. None:1:1
Selector expected. Ruleset ignored due to bad selector. None:28:21
Dangling combinator. Ruleset ignored due to bad selector. None:33:21
Ruleset ignored due to bad selector. None:1204:8
Found invalid value for media feature. erpnext-web.bundle.css:338
Found invalid value for media feature. erpnext-web.bundle.css:344
Found invalid value for media feature. erpnext-web.bundle.css:357
Found invalid value for media feature. erpnext-web.bundle.css:362
Error in parsing value for βwidthβ. Declaration dropped. erpnext-web.bundle.css:1199:2
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:9000/socket.io/?EIO=4&transport=polling&t=P5URclv . (Reason: CORS request did not succeed). Status code: (null).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:9000/socket.io/?EIO=4&transport=polling&t=P5URdV3 . (Reason: CORS request did not succeed). Status code: (null).
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:9000/socket.io/?EIO=4&transport=polling&t=P5URf0J . (Reason: CORS request did not succeed). Status code: (null).