My plugin made building nodebb.min.js failed

Technical Support
  • So now after activating my plugin and restarting nodebb, nodebb.min.js contains only one line: undefined, always in production mode and sometime in dev mode.

    Is there something wrong with my client code that it made the build failed ? It pass through airbnb style guide, and used to work as expected 😦

    It's here:

    $(document).ready(function () {
      'use strict';
    
      $(window).on('action:ajaxify.end', function () {
        // console.log(info);
        $('#autoduc-button').click(function () {
          $('#autoduc-dialog').modal();
        });
    
        $('#autoduc-send').click(function () {
          const url = $('#autoduc-url').val();
          // console.log(url);
          $.post('/api/autoduc', {
            url: url,
            cid: ajaxify.data.cid,
          }, function success(data) {
            const tid = data.tid;
            if (tid) {
              ajaxify.go('topic/' + tid);
            } else {
              app.alert({
                alert_id: 'autoduc-failed',
                type: 'danger',
                title: 'Failed',
                message: 'Post not found',
              });
            }
          });
        });
      });
    });
    

    Nodebb: 1.5.2
    Node: 6.11.2

    Thanks in advance.

  • Replace const with var the minifier we use does not support es6 yet.

  • @baris tks u very much, now code works. 🙂

    Let add this to the plugin docs.


Suggested Topics


  • 0 Votes
    1 Posts
    133 Views
  • nodebb version

    Technical Support
    0 Votes
    4 Posts
    276 Views
  • 0 Votes
    22 Posts
    1656 Views
  • 0 Votes
    8 Posts
    3155 Views
  • 0 Votes
    26 Posts
    6721 Views