Js line number indication in crash line log is not adequate

Describe the bug

If I create a JS code block into an extension function, the indicated code number is not the one of the code line in the function, and irrelevant as it exceeds the line number of the JS block.

Steps to reproduce

  • do a function in JS into an extension

  • make a bug in this function

  • check the number of the indicated line

Share a very simple GDevelop project showing the bug

Hi! As far as I know, this is how GDevelop works rather than a bug, but I agree it’s confusing.

The line numbers in that error (like inventorygridmother.js:401) don’t point to the lines of your JS block. They point to the generated file that GDevelop creates for the whole extension. That file contains all your events and functions, with your JS code pasted inside, so the number can easily be bigger than the number of lines in your block.

To find the real line:

  1. Open the developer tools in the preview (View > Toggle Developer Tools, like the error message says).
  2. In the Console, click the file link in the error (for example ...inventorygridmother.js:401:48). It opens the generated file at that exact line.
  3. Your own code is right there, so you can see which line is failing.

If you can’t find it that way, you can also search that file for a line from your code.

An option to map the number back to the original JS block would be a nice feature request, though. Hope this helps! :slightly_smiling_face: