error - C:\Users\michael\Downloads\sendbird\node_modules@sendbird\uikit-react\App.js:1
import { a as _slicedToArray } from ‘./_rollupPluginBabelHelpers-abbcef5e.js’;
^^^^^^
SyntaxError: Cannot use import statement outside a module
source code:
import React from “react”;
import { App as SendbirdApp } from “@sendbird/uikit-react/App”;
import “@sendbird/uikit-react/dist/index.css”;
import styles from “…/styles/conversations.module.css”;
This error occurs when you try to use an import statement outside a module. This can happen in different cases depending on whether you’re working with JavaScript on the server-side with Node.js , or client-side in the browser. There are several reasons behind this error, and the solution depends on how you call the module or script tag. Solutions:
Add type=“module” inside the script tag
Add “type”: “module” to your package.json
Use the extension .mjs in your files
Use import by required
If you’re still getting the error even though you’re using import in a module file, make sure that your JavaScript environment supports modules. Some older browsers and Node.js versions do not support modules natively, and you may need to use a module bundler like Webpack or rollup.js to transform your module code into a format that can be used in your environment.