cuongdevjs / reactjs-social-login

Group Hook ReactJS components for login social network
https://react-social-login.netlify.app
MIT License
168 stars 75 forks source link

Error: require() of ES Module #160

Open tiagocardosoc opened 9 months ago

tiagocardosoc commented 9 months ago

Hello, I'm trying to use the reactjs-social-login in a NextJs application and I'm facing with a error while I'm trying execute the component FacebookSocialLogin.

Basically, when I try execute it, I get this error:

Error: require() of ES Module /home/tiagocardosoc/workspace/beduka-web-ssr/node_modules/reactjs-social-login/dist/reactjs-social-login.js from xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.js not supported. reactjs-social-login.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. Instead rename reactjs-social-login.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 /xxxxxxxxxxxxxxxxxxxxxxxxx/node_modules/reactjs-social-login/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).

I'm not using modules in my app. Any Idea?