Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with new installation #30

Closed
SdeGeata opened this issue Oct 1, 2021 · 2 comments · May be fixed by #31
Closed

Problem with new installation #30

SdeGeata opened this issue Oct 1, 2021 · 2 comments · May be fixed by #31

Comments

@SdeGeata
Copy link

SdeGeata commented Oct 1, 2021

Hello;

So I am in the process of upgrading to a R.pi 4 and in doing so, am now installing my favorite modules on the new device. I am however running into issues with this module. It keeps throwing errors. Here's the log:

0|mm | [30.09.2021 20:26.15.090] [ERROR] 0|mm | App threw an error during load 0|mm | [30.09.2021 20:26.15.091] [ERROR] Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/pi/MagicMirror/modules/MMM-Parcel/node_modules/node-fetch/src/index.js 0|mm | require() of ES modules is not supported. 0|mm | require() of /home/pi/MagicMirror/modules/MMM-Parcel/node_modules/node-fetch/src/index.js from /home/pi/MagicMirror/modules/MMM-Parcel/node_helper.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. 0|mm | Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/pi/MagicMirror/modules/MMM-Parcel/node_modules/node-fetch/package.json. 0|mm | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1169:13) 0|mm | at Module.load (internal/modules/cjs/loader.js:992:32) 0|mm | at Module._load (internal/modules/cjs/loader.js:885:14) 0|mm | at Function.f._load (electron/js2c/asar_bundle.js:5:12633) 0|mm | at Module.require (internal/modules/cjs/loader.js:1032:19) 0|mm | at require (internal/modules/cjs/helpers.js:72:18) 0|mm | at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Parcel/node_helper.js:9:18) 0|mm | at Module._compile (internal/modules/cjs/loader.js:1152:30) 0|mm | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) 0|mm | at Module.load (internal/modules/cjs/loader.js:992:32) 0|mm | [30.09.2021 20:26.15.092] [ERROR] Whoops! There was an uncaught exception... 0|mm | [30.09.2021 20:26.15.099] [ERROR] 0|mm | Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/pi/MagicMirror/modules/MMM-Parcel/node_modules/node-fetch/src/index.js 0|mm | require() of ES modules is not supported. 0|mm | require() of /home/pi/MagicMirror/modules/MMM-Parcel/node_modules/node-fetch/src/index.js from /home/pi/MagicMirror/modules/MMM-Parcel/node_helper.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules. 0|mm | Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /home/pi/MagicMirror/modules/MMM-Parcel/node_modules/node-fetch/package.json. 0|mm | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1169:13) 0|mm | at Module.load (internal/modules/cjs/loader.js:992:32) 0|mm | at Module._load (internal/modules/cjs/loader.js:885:14) 0|mm | at Function.f._load (electron/js2c/asar_bundle.js:5:12633) 0|mm | at Module.require (internal/modules/cjs/loader.js:1032:19) 0|mm | at require (internal/modules/cjs/helpers.js:72:18) 0|mm | at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Parcel/node_helper.js:9:18) 0|mm | at Module._compile (internal/modules/cjs/loader.js:1152:30) 0|mm | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10) 0|mm | at Module.load (internal/modules/cjs/loader.js:992:32) { 0|mm | code: 'ERR_REQUIRE_ESM' 0|mm | } 0|mm | [30.09.2021 20:26.15.100] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection? 0|mm | [30.09.2021 20:26.15.101] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues

How can I fix this?

@SdeGeata
Copy link
Author

@martinkooij : Any idea how i can fix this? It worked before this.

rejas added a commit to rejas/MMM-Parcel that referenced this issue Oct 10, 2021
Fixes martinkooij#30  
node-fetch v3 has breaking changes, so this PR sets its version to the last good one.
@SdeGeata
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant