qooxdoo-compiler icon indicating copy to clipboard operation
qooxdoo-compiler copied to clipboard

Error compiling file `url.replace is not a function`

Open rad-pat opened this issue 5 years ago • 9 comments
trafficstars

Files with a comment such as // [Constructor] within the class definition fail to compile since 1.0.0-beta.20200320-1542 release

qx.Class.define("myapp.ui.myClass", {
    extend: qx.ui.core.Widget,
    // --------------------------------------------------------------------------
    // [Constructor]
    // --------------------------------------------------------------------------
    construct: function()

rad-pat avatar Mar 21 '20 16:03 rad-pat

Found the problem. You can now use markdown in your comments, [Constructor] is a markdown link tag which can not be parsed via Showdown Framework to an valid url. I will insert some error handling in the markdown cobersion calls.

hkollmann avatar Mar 21 '20 18:03 hkollmann

Here is the PR: https://github.com/qooxdoo/qooxdoo-compiler/pull/634 Thanks for reporting!

hkollmann avatar Mar 21 '20 18:03 hkollmann

Done with #634

hkollmann avatar Mar 23 '20 08:03 hkollmann

Thanks for the quick fix!

rad-pat avatar Mar 23 '20 09:03 rad-pat

It is reports that this is still happening, by the OP and by @level420

@level420

Markdown conversion error: "url.replace is not a function" found in ntrol.ImportList
[Constructor]

@level420 Well I've stripped the file down to

qx.Class.define("my.application.control.ImportList",
{
  extend : my.application.control.EditableList,

  members :
  {
    /**
     * Create an editor instance
     *
     * @return {Object}
     */
    _createEditorInstance : function() {
      return null;
    }
  }
});

and still get the message. If I remove the doc/comment like this:

qx.Class.define("my.application.control.ImportList",
{
  extend : my.application.control.EditableList,

  members :
  {
    _createEditorInstance : function() {
      return null;
    }
  }
});

it's gone.

johnspackman avatar May 05 '20 15:05 johnspackman

@derrell : I can not reproduce this with test cases. Could you create a small example project?

hkollmann avatar May 05 '20 20:05 hkollmann

@hkollmann, to reproduce, replace the line comments in the original example to a block comment

qx.Class.define("myapp.ui.myClass", {
    extend: qx.ui.core.Widget,
    /**
    * --------------------------------------------------------------------------
    * [Constructor]
    * --------------------------------------------------------------------------
    */
    construct: function()

rad-pat avatar May 06 '20 07:05 rad-pat

[Constructor] is the problem since we use markdown in comments. This is an invalid link. So the message is correct. It should be a warning and try to use the text without markdown support

hkollmann avatar May 06 '20 07:05 hkollmann

It should be a warning, however the current output is somehow garbled and repeated and indication to the position of the problem in the source is currently not working:

qx compile --clean
Markdown conversion error: "url.replace is not a function" found in irtual
[Constructor]
Markdown conversion error: "url.replace is not a function" found in 
[Constructor]
Markdown conversion error: "url.replace is not a function" found in 
[Constructor]

In the above output, there is only one instance of this invalid url and the file was called UploadForm.js

rad-pat avatar May 06 '20 08:05 rad-pat