You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did you try using just Remote Control alone with MM?
I have and the error still happening
Description
Remote-Control will not load ES Modules, and instead throws the following errors:
0|mm | [2024-05-16 10:48:22.279] [ERROR] 2024-05-16T10:48:22 <error> ERROR! Could not load main module js file. Error found: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/username/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js from /home/username/MagicMirror/modules/MMM-Remote-Control/node_helper.js not supported.
0|mm | MMM-RAIN-MAP.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
0|mm | Instead either rename MMM-RAIN-MAP.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs"in /home/username/MagicMirror/modules/MMM-RAIN-MAP/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
0|mm | (/home/username/MagicMirror/modules/MMM-Remote-Control/node_helper.js:323 Class.loadModuleDefaultConfig)
Expected behavior
Either the module should use import() as suggested, or, if the module cannot handle ES Modules, it should check whether the module is an ES Module and not attempt to import it.
Current behavior
Log error as shown above.
Possible solution
?
Steps to reproduce
Start MM with both MMM-remote-control and an ES Module module active.
See error
Log
0|mm | [2024-05-16 10:48:22.279] [ERROR] 2024-05-16T10:48:22 <error> ERROR! Could not load main module js file. Error found: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/username/MagicMirror/modules/MMM-RAIN-MAP/MMM-RAIN-MAP.js from /home/username/MagicMirror/modules/MMM-Remote-Control/node_helper.js not supported.
0|mm | MMM-RAIN-MAP.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
0|mm | Instead either rename MMM-RAIN-MAP.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs"in /home/username/MagicMirror/modules/MMM-RAIN-MAP/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
0|mm | (/home/username/MagicMirror/modules/MMM-Remote-Control/node_helper.js:323 Class.loadModuleDefaultConfig)
config.js
n/a
Additional info
No response
The text was updated successfully, but these errors were encountered:
OS
Raspbian 12
NodeJS Version
18.19.0
MagicMirror² Version
2.27.0
Remote Control Version
2.3.8
Did you try using just Remote Control alone with MM?
Description
Remote-Control will not load ES Modules, and instead throws the following errors:
Expected behavior
Either the module should use
import()
as suggested, or, if the module cannot handle ES Modules, it should check whether the module is an ES Module and not attempt to import it.Current behavior
Log error as shown above.
Possible solution
?
Steps to reproduce
Log
config.js
Additional info
No response
The text was updated successfully, but these errors were encountered: