How to identify which plugin causes error


(Christoph) #1

My error log is repeatedly showing this error:

TypeError: Cannot read property ‘on’ of undefined
at https://forum.example.com/assets/plugin-third-party-79ea46991b76279d783d995c65d62ffb2f95ae7e68e0c79644ba01b7649d2a95.js:1:14095
at https://forum.example.com/assets/plugin-third-party-79ea46991b76279d783d995c65d62ffb2f95ae7e68e0c79644ba01b7649d2a95.js:1:14175

How do I know which plugin this javascript file is from?


(Régis Hanol) #2

By disabling them all and then enabling them one by one.


(Christoph) #3

Hm, the problem is that the error seems to occur intermittently so that if it doesn’t occur, I can never be sure whether it’s because the plugin is disabled or because it decided to keep quiet for a while. Any other way?


(Régis Hanol) #4

Apart from studying the source code of each plugins, I can’t think of any other way.


(Christoph) #5

I have tried to find that js file to see if there’s any hint in it, but I have no idea where to find it (I’m using docker).


(Andrew Waugh) #6

What do the info, backtrace, and env tabs of /logs contain for that error?


(Christoph) #7

Info (domain replaced):

Uncaught TypeError: Cannot read property 'on' of undefined
Url: https://forum.example.com/assets/plugin-third-party-865e853871f20eeae50c3bede19ef7d8bd5352766ee238799cb2bb94caaecd68.js
Line: 1
Column: 14095
Window Location: https://forum.example.com/latest

The OP was from b.acktrace

env (edited):

hostname	***
process_id	[143, 135, 150]
application_version	f918951d42234790938da442a768c2bf80f87069
HTTP_HOST	forum.example.com
REQUEST_URI	/logs/report_js_error
REQUEST_METHOD	POST
HTTP_USER_AGENT	[Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36, Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36]
HTTP_ACCEPT	*/*
HTTP_REFERER	https://forum.example.com/
HTTP_X_FORWARDED_FOR	[83.xx.xx.xx, unix:, 130.xxx.xx.xx, unix:]
HTTP_X_REAL_IP	unix:
params	
message	Uncaught TypeError: Cannot read property 'on' of undefined Url: https://forum.example.com/assets/plug
url	https://forum.example.com/assets/plugin-third-party-865e853871f20eeae50c3bede19ef7d8bd5352766ee238799
line	1
column	14095
window_location	https://forum.example.com/
stacktrace	TypeError: Cannot read property 'on' of undefined at https://forum.example.com/assets/plugin-thir

(Andrew Waugh) #8

Hmn, I’m no smarter now than I was 29 minutes ago. (same goes for hours, days and months).

What plugins have your got installed?

Try
./launcher enter app
cd public/assets
cat plugin-third-party-865e853871f20eeae50c3bede19ef7d8bd5352766ee238799cb2bb94caaecd68.js
(actually “cat plugin-third-party-865e” then tab to auto complete, the first hit will probably be the .js file)

You will find the name of the plugin mentioned in the .js file if you scroll up.

(There are more elegant ways to do this.)


(Christoph) #9

This, I thought was quite elegant and fast. I found the perpetrator it’s the national-flags plugin and I will disable it right away. Thank you so much!