frappe: Invalid or unexpected token prevent accessing ERPNext Desk
Information about bug
After upgrading to Frappe-bench V14, ERPNext Desk is stocking at LOGO in production mode. I have looked up others who were also experiencing same issue when they were using Frappe-bench V13 before.
Reference link: https://discuss.erpnext.com/t/erpnext-desk-stuck-at-logo-in-production/81143
Uncaught SyntaxError: Invalid or unexpected token
listing.html:2 Uncaught TypeError: Cannot set properties of undefined (setting 'listing')
at listing.html:2:19
at kanban_card.html:2:36
address_list.html:2 Uncaught TypeError: Cannot set properties of undefined (setting 'address_list')
at address_list.html:2:19
at index.js:107:1
capture.js:14 Uncaught TypeError: Cannot set properties of undefined (setting 'get_data_uri')
at capture.js:14:10
at control.js:53:1
report_factory.js:4 Uncaught TypeError: Cannot read properties of undefined (reading 'Factory')
at report_factory.js:4:71
at report_utils.js:155:1
As you can see, the desk doesn’t work when accessed through the set domain https://erp.mydomain.com/ but works fine through http://serverip:8000/app. The previous solution for this is to use stable version of Frappe-bench V13. Since now ERPNext V14 requires Frappe-bench V14, I am limited to V14.0.0 and V14.0.2. I have tried both, they all result the same issue.
Module
other
Version
V14.0.2
Installation method
No response
Relevant log output / Stack trace / Full Error Message.
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (4 by maintainers)
@JingerTea can you rebuild assets? Can you click on the first error message to see from where the error message is originating? If you can’t share that then perhaps share that desk.bundle file so we can have a look.
to rebuild assets:
bench build --force@ankush Sometimes when i run bench build with or without force, it works. But as soon as i clear cache(ctrl+shift+r) the same exact error returns.
Even when i reinstall, I the desk loads, but as soon the cache is cleared the error returns.
i also updated node to 16.15.0
@ankush : I have applied your suggested change (
taget: ["esnext"]), and re-enabled Cloudflare with all of its optimizations.It does seem to be fixing the error. I will keep it like this for a few days and report back.