📜 ⬆️ ⬇️

Do not miss js-error

Developing and testing the site, you often notice not all js-errors. This happens for a number of reasons:

To solve the problem, I wrote a small js-script " show-js-error ", which displays a noticeable js-error message when it appears in the browser.



On the display of messages, everything does not end, it is important to make a mistake. Correct description of the bug - fix half of the bug.
')
To do this, in the task of fixing the bug, you must specify the information:




In order not to waste time each time, we will use the “Copy” button to copy all error information to the clipboard. Or the button “Send”, the establishment of a bug with which takes only one click.

True, Githubʼa will need two clicks - click on the “Send” button in the message and “Submit new issue” on Github itself.
When making a new Issue, the header and text of the message can be forwarded through GET parameters.
https://github.com/hcodes/show-js-error/issues/new?title=My%20title&body=My%20text

Fast start


Install:
npm install show-js-error 


We connect to our page in <head> before all scripts:
 <link rel="stylesheet" href="./node_modules/show-js-error/dist/show-js-error.css" /> <script src="./node_modules/show-js-error/dist/show-js-error.js"></script> 


You can also show other types of errors, for example, errors from the server that are thrown to the page:
 showJSError.show({ title: 'Server error', message: 'My message', stack: 'My stack' }); 


Eventually:


References:

Source: https://habr.com/ru/post/280212/


All Articles