question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid or unexpected token prevent accessing ERPNext Desk

See original GitHub issue

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
Screen Shot 2022-08-06 at 3 37 25 AM

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
shinzucocommented, Aug 9, 2022

@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

1reaction
dgehrigercommented, Aug 12, 2022

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 ......
Read more >
V14 not working when accessed from iPhone or Android
Please disregard this thread. The underlying problem was indeed Invalid or unexpected token prevent accessing ERPNext Desk · Issue #31785 · ...
Read more >
SyntaxError: Unexpected token (80:2) when I install ERPNext
Hi @everyone I'm installing ERPNext on Ubuntu 18. I'm cloning from github. do I need to change the code?
Read more >
Can not go to desk after run bench update - ERPNext Forum
After I run bench update --patch I got this error: Server: SyntaxError: Unexpected token (18:3487) in ...
Read more >
Can't Access Desk after login, only showing ERPNext Logo
Can't Access Desk after login, only showing ERPNext Logo ... It says:- Uncaught SyntaxError: Unexpected token { desk:41 on console
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found