Jopyth/MMM-Remote-Control

SyntaxError: Invalid or unexpected token

Ryancru2309 opened this issue · 8 comments

I have a problem

|Questions||
I keep getting this error when i run my MM. Any one know why?

Description

SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:896:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Module._load (internal/modules/cjs/loader.js:728:14)
at Function.Module._load (electron/js2c/asar.js:748:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Class.loadModuleDefaultConfig (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:313:30)
at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:224:26
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)


### config.js

```js
{
			module: "MMM-Remote-Control",
			// uncomment the following line to show the URL of the remote control on the mirror
			position: "bottom_left",
			// you can hide this module afterwards from the remote control itself
			config: {
			customCommand: {}, // Optional, See "Using Custom Commands" below
			customMenu: "custom_menu.json", // Optional, See "Custom Menu Items" below
			showModuleApiMenu: true, // Optional, Enable the Module Controls menu
			apiKey: "", // Optional, See API/README.md for details
			}
			},
### Additional info

<!-- Everything else that you think could be useful for us. ;D -->

Having a quick look at the error, seems to be a problem with the reading in the folder.

Do you have any other module beside the Remote Control? If you take it out, the mirror starts with default configuration (This happens if you don't set a config file)?

Also I'm gonna need your OS and type of instalation of the MagicMirror.

I have a few modules in and they all work fine. The modues that i am using are as follows;
MMM-Screencast
MMM-Spotify
MMM-Network Connection
Linux raspberrypi 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux
MagicMirror Version 2.14.0

I have took each of the added modules out and still get the error above im afraid.

Hello, just wodering if there is any update on this?

Hey! Sorry about let you waiting so long.

Are you using the custom menu option? Could you comment it from the config file to see if that's the problem?

No problem! Just can't see why its not working. This is the error im getting this error which is the same as the one above.

SyntaxError: Invalid or unexpected token
at Module._compile (internal/modules/cjs/loader.js:896:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Module._load (internal/modules/cjs/loader.js:728:14)
at Function.Module._load (electron/js2c/asar.js:748:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Class.loadModuleDefaultConfig (/home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:313:30)
at /home/pi/MagicMirror/modules/MMM-Remote-Control/node_helper.js:224:26
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)

Could be a problem with another module, because the error it's just where a function looks for other modules. How did you take them out?

After searching for those modules, Screencast seems to have some issues of compatibility. Also, I cannot find the Spotify module. I recommend taking both out of the module folder and the config file and try again.

Also, the error doesn't have to stop the MM, because it's handled. I'm gonna check that out in a minute. Let me know if that works for you, and which one you're getting the error.

Edit: Is there a default folder inside your modules folder?

Alright, after a long check in every corner of every code, I determined that the problem is one of the default modules. I would need the full log to see which one, and what's the problem exactly. Roughly the error I could bring it's this:
image
As you can see I force it adding a @, but your problem should also tell you where's the error.

Surely reinstalling MM would solve the problem.

I didn't get any response from you in a while, so I'm gonna close this issue. Feel free to re-open it or create another if you need more help. Cheers :D