Javascript errors in latest 0.7.x

  • GNU/Linux

    Ever since updating last night to the latest master version i'm getting these errors in the console in the admin section:

    Uncaught SyntaxError: Unexpected token <define @ nodebb.min.js?v=v0.5.0-2-3305-g62a2e9f:13(anonymous function) @ nodebb.min.js?v=v0.5.0-2-3305-g62a2e9f:14(anonymous function) @ nodebb.min.js?v=v0.5.0-2-3305-g62a2e9f:14
    Uncaught TypeError: Cannot read property 'emit' of undefined admin.js?v=v0.5.0-2-3305-g62a2e9f:28 

    Since these errors have shown up I can no longer submit ajax requests like disabling plugins, reloading the server, etc. I can still navigate to different parts of the ACP but nothing else works.

    Also, the "unexpected token" error is everywhere on the forum, not just the admin page.

    This is with the latest version of 0.7.x and the latest Persona theme if that matters.

    Before you ask yes I have cleared my cache of all javascript, even used a fresh browser, no effect.

  • GNU/Linux Admin

    Have you tried resetting plugins on your install?

    The most drastic thing you can try would be to blow away the node_modules/ folder altogether, and npm i again, followed by ./nodebb setup

  • GNU/Linux

    @julian No dice. Did both, reset plugins which didn't work and then blew away the node_modules and re-ran npm i and ./nodebb setup (didn't know it would nuke my config.json... good thing i had a backup). Neither method fixed the issue.

  • GNU/Linux Admin

    Hm... git rev-parse HEAD please.

  • GNU/Linux

    @julian 62a2e9fdd0f16bb872ac8ee1a4322b10ac54e108

  • Admin

    Also npm ls templates.js?

  • GNU/Linux


    nodebb@0.7.0-dev /data/nodebb2
    └── templates.js@0.2.4

  • GNU/Linux Admin

    Are you running a custom theme or any modified core code?

  • GNU/Linux

    @julian Nope, vanilla everything. I do have some custom CSS in the custom CSS section of the ACP to fix some skinning problems of Persona but no javascript or anything.

  • GNU/Linux Admin

    Delete nodebb.min.js in public/?

  • GNU/Linux

    @julian Did that. I even nuked the entire public directory and re-pulled it down from git just to make sure. Restarted nginx and cleared all cache in the browsers.

  • GNU/Linux

    @julian Ok so I booted up a new freshly installed windows VM and loaded up firefox. Visiting my forum I don't see any of these errors. I don't know what's going on with my chrome/firefox/opera/safari on my other systems but they seem to be holding onto the cache even though i've cleared it many times completely and rebooted. For some reason they continue to have the errors...

  • Admin

    From the second error in OP, I would assume that socket isn't defined. Can you "view source" on the ACP home page and paste the contents of <head> please?

  • GNU/Linux

    @psychobunny Sure, here ya go:

    	<title>NodeBB Admin Control Panel</title>
    	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    	<link rel="stylesheet" href="/vendor/jquery/css/smoothness/jquery-ui-1.10.4.custom.min.css?v=v0.5.0-2-3305-g62a2e9f">
    	<link rel="stylesheet" type="text/css" href="/vendor/nanoscroller/nanoscroller.css?v=v0.5.0-2-3305-g62a2e9f">
    	<link rel="stylesheet" type="text/css" href="/admin.css?v=v0.5.0-2-3305-g62a2e9f" />
    		var RELATIVE_PATH = "";
    		var config = JSON.parse('{"relative_path":"","socketioTransports":["polling","websocket"],"websocketAddress":"","version":"0.7.0-dev","siteTitle":"NZBCat Forums","showSiteTitle":true,"postDelay":"10","minimumTitleLength":"3","maximumTitleLength":"255","minimumPostLength":"8","maximumPostLength":"32767","hasImageUploadPlugin":true,"maximumProfileImageSize":"256","minimumUsernameLength":"2","maximumUsernameLength":"16","minimumPasswordLength":"6","maximumSignatureLength":"255","maximumAboutMeLength":"500","useOutgoingLinksPage":false,"allowGuestSearching":false,"allowGuestHandles":false,"allowFileUploads":false,"allowProfileImageUploads":true,"allowTopicsThumbnail":false,"allowAccountDelete":false,"privateUserInfo":true,"privateTagListing":false,"usePagination":false,"disableSocialButtons":false,"disableChat":false,"maxReconnectionAttempts":5,"reconnectionDelay":1500,"tagsPerTopic":5,"minimumTagLength":3,"maximumTagLength":15,"topicsPerPage":20,"postsPerPage":10,"maximumFileSize":"2048","theme:id":"nodebb-theme-persona","defaultLang":"en_US","userLang":"en_US","loggedIn":true,"cache-buster":"v0.5.0-2-3305-g62a2e9f","script-buster":"7c252825","css-buster":"9d2983c6","requireEmailConfirmation":false,"topicPostSort":"oldest_to_newest","categoryTopicSort":"newest_to_oldest","csrf_token":"v6xPIZMH-i2zZSdlzssZA8HFfa9udNvgugus","searchEnabled":true,"notificationSounds":false,"openOutgoingLinksInNewTab":false,"topicSearchEnabled":false}');
    		var app = {
    			template: "admin/general/dashboard",
    			user: JSON.parse('{"username":"KingCat","userslug":"kingcat","email":"","picture":"/uploads/profile/5-profileimg.png","email:confirmed":false,"uid":5}')
    	<!--[if lt IE 9]>
    		<script src="//"></script>
    		<script src="//"></script>
    		<script src="//"></script>
    		<script>__lt_ie_9__ = 1;</script>
    		<script type="text/javascript" src="/vendor/chart.js/chart.min.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/hammer/hammer.min.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/nodebb.min.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    				baseUrl: "/src/modules",
    				waitSeconds: 3,
    				urlArgs: "v=v0.5.0-2-3305-g62a2e9f",
    				paths: {
    					'admin': '../admin',
    					'vendor': '../../vendor',
    					'buzz': '../../vendor/buzz/buzz.min'
    			app.inAdmin = true;
    		<script type="text/javascript" src="/vendor/colorpicker/colorpicker.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/src/admin/admin.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/ace/ace.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/nanoscroller/nanoscroller.min.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/jquery/event/jquery.event.drag.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/jquery/event/jquery.event.drop.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/semver/semver.browser.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/jquery/serializeObject/"></script>
    		<script type="text/javascript" src="/vendor/jquery/deserialize/jquery.deserialize.min.js?v=v0.5.0-2-3305-g62a2e9f"></script>
    		<script type="text/javascript" src="/vendor/mousetrap/mousetrap.js?v=v0.5.0-2-3305-g62a2e9f"></script>

    BTW, I've re-enabled all the plugins as they didn't seem to affect this issue.

  • im have same problem

  • I also have this very same problem. But it only happens when minified js file is used (./nodebb start instead of ./nodebb dev)

    Any solution yet?

  • Admin Staff

    We haven't figured out why this is happening yet, relevant GH issue

    pichalite created this issue in NodeBB/NodeBB

    closed JS errors on fresh install of v0.7.x #3200

  • This post is deleted!

Log in to reply

Suggested Topics

  • 2
  • 3
  • 4
  • 1
  • 2
| |