Translation failed: ReferenceError: componentHandler is not defined

Solved Technical Support
  • Hello, I just installed the latest version 1.4.2 and i get this error in the chrome console when i navigate around the admin pages:

    Translation failed: ReferenceError: componentHandler is not defined

    I tried both UK English and US English as the language.

    Also, not sure if this is related or not but when i navigate to category priv section the checkboxes are not visible and i get this:

    {function.spawnPrivilegeStates, name, privileges} {function.spawnPrivilegeStates, name, privileges} {function.spawnPrivilegeStates, name, privileges} {function.spawnPrivilegeStates, name, privileges}

    Refreshing the page fixes the checkboxes and the above writing.


  • Turns out that my company is blocking the following file from downloading:

    When i tried my dev build off my works netork it worked fine.

    Is there away to add this file locally so it doesnt have to fetch it from storage.googleapis (which is blocked)?


  • @whitts you should call IT and have them unblock that. Anyways, the inclusion of the file is on line 23 of src/views/admin/header.tpl. If you change that line from this:

    <script src=""></script>

    To this:

    <script src="{relative_path}/material.min.js"></script>

    And then download the file and store it in public/, it will load it from the NodeBB server.

  • @PitaJ Thanks for the info.. This is the material light library right? Yeh doubt they will change their policies for storage sites.. My company was bought by another and they even blocked SD card \ USB writes. Thanks.

Suggested Topics

  • 0 Votes
    7 Posts

    @julian I confirm the issue is resolved, many thanks for the quick support ☺️

  • 0 Votes
    2 Posts

    Please provide more context on what you're trying to do. It will help to see if there is a way to avoid translating manually.

    It looks like you're trying to use it server-side. In that case, there are some complicating factors around providing the current user's language.

    Anyways, to import translator you want to do require.main.require('./src/translator')

    To translate a bunch of words there are a couple options:

    Join tokens into a single string and translate it, then split the tokens, like so const tokens = [ '[[myplugin:greeting1]]', '[[myplugin:greeting2]]', ].join('|||'); // language is only required if server-side here translator.translate(tokens, language, (translated) => { const [greeting1, greeting2] = translated.split('|||'); // etc });

    This works well, especially when you need to translate from multiple namespaces, but has a fair amount of overhead.

    Get translations directly and pick the ones you want, like so // language is required here translator.getTranslations(language, 'myplugin', (translations) => { const { greeting1, greeting2 } = translations; // etc });

    This works great with single namespaces but with multiple namespaces it gets a little more complicated.

  • 0 Votes
    28 Posts

    @julian said in Upgrade from 1.8.1 to 1.8.2 failed:

    Yes... that's correct. If you want, you can set package_manager to yarn, so the nodebb upgrade process uses yarn as well.

    Then you should be good to go.

    ok, I'll try this on production tomorrow.

    Thanks for you help so far!

  • 0 Votes
    10 Posts

    So, I just tested leaving the allowed filetypes-field blank (ergo allowing everything) and that worked. The mov-file gets uploaded flawlessly.

    But interestingly the response is:

    name: "" path: "/opt/bitnami/apache2/htdocs/public/uploads/files/1496310135527-sample.qt" url: "/assets/uploads/files/1496310135527-sample.qt"

    Adding just the mov extension to the allowed file-extensions blocks it again.

    Now the response suggests to me somehow, that nodebb is converting the uploaded file to a .qt-file.

    So I just added the qt-extension to the allowed files and it works.

    It's really weird behavior, but I found a solution. Thanks for participating everyone!

  • 0 Votes
    2 Posts

    managed to fix it by putting the ip address in the facebook url.. not the same one that is in config.json