Javascript errors in latest 0.7.x
-
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.
-
@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.
-
Also
npm ls templates.js
? -
[email protected] /data/nodebb2 āāā [email protected]
-
@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...
-
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? -
@psychobunny Sure, here ya go:
<head> <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" /> <script> 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":"[email protected]","picture":"/uploads/profile/5-profileimg.png","email:confirmed":false,"uid":5}') }; </script> <!--[if lt IE 9]> <script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/2.3.0/es5-shim.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js"></script> <script>__lt_ie_9__ = 1;</script> <![endif]--> <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> <script> require.config({ 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> <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/jquery.ba-serializeobject.min.js?v=v0.5.0-2-3305-g62a2e9f"></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> </head>
BTW, I've re-enabled all the plugins as they didn't seem to affect this issue.