CSS/JS min issue with V13

Hi All,

We just updated our instance from V12 to V13, and we noticed severe performance issues. First we checked with “ngxtop” on the server what the end points are that are called.

ERPNext: v13.35.2 (version-13)
Frappe Framework: v13.35.2 (version-13)

The unusual thing is the 43 requests per second which are actually not listed in the count as regular URLs that are being called. As you can see in 220 secondfs we have 9557 calls.

We then noticed these calls are coming from a few IP addresses. Upon checking with those users we could see that their desk was frozen and if you go into debug / network in the browser you can see that it is making a lot of calls to .js and .css files that are in our public/build.json and hooks.py of custom apps. The error didn’t replicate right away but then we noticed that when we hit the refresh button on our browsers it happens too.

We have these unusual calls in our network tab.

I am also seeing it in my desk console on reload.

When clicking on the error, it shows me an svg.min.js which when clicked, shows the source code of the home desk.

So, here is what we know:

Noticed something:

  • when we are on https://ourerpsystem.com/app and hit reload (or ctrl+r / ctrl+shift+r / user icon “reload” then nothing happens. We can not provoke the error to happen.
  • When we are in a workspace such as “app/assets” and then reload we always get the error.

Strange issue. Am yet to figure-out why this happens : /

But in the meanwhile you can set absolute path (start the path with “/”) for you minified files in hook.py of your app.
We used this solution for one of our apps.

Let me know if this helps.

2 Likes

@surajshetty identified the problem has something to do with the path …

Change from

app_include_js = ["assets/js/beluga.min.js",
                  "assets/js/ddslick.min.js"]
app_include_css = [
		"assets/css/beluga.css"
	]

To

app_include_js = ["/assets/js/beluga.min.js",
                  "/assets/js/ddslick.min.js"]
app_include_css = [
		"/assets/css/beluga.css"
	]

This has to do with Version 13’s new /app/ in the path. So, that’s why going from assets/ to /assets/ with the added slash does the trick.

2 Likes