tawk / tawk-messenger-react

Official React plugin for Tawk messenger
https://www.tawk.to
Other
23 stars 15 forks source link

SyntaxError: Cannot use import statement outside a module #6

Open hokagedemehin opened 2 years ago

hokagedemehin commented 2 years ago

Hello,

After installing the official tawk react package, I get this error SyntaxError: Cannot use import statement outside a module. please could you assist in resolving it?

File name where error occurs file:///C:/Users/user/project/nextjs-project/node_modules/%20(tawk.to/tawk-messenger-react/src/index.js

shahidcodes commented 2 years ago

Same

max-degterev commented 2 years ago

This is just a very thin wrapper over a loader. It's best to use something like React Script or https://nextjs.org/docs/basic-features/script instead

If it was a full reimplementation avoiding loading the script from tawk.to cdn that would another matter.