• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

My plugin made building nodebb.min.js failed

Scheduled Pinned Locked Moved Technical Support
3 Posts 2 Posters 1.0k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    voanhcuoc
    wrote on last edited by voanhcuoc
    #1

    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.

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #2

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

    V 1 Reply Last reply
    1
  • V Offline
    V Offline
    voanhcuoc
    replied to <baris> on last edited by voanhcuoc
    #3

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

    Let add this to the plugin docs.

    1 Reply Last reply
    1

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development