React.js + Vite
I am trying to build a widget and I have this error:
Cannot use import statement outside a module
ContentScript.tsx
import { createRoot } from 'react-dom/client';
const Hello = () => {
return <div>HELLO EXTENSION!</div>;
};
const AppContainer = document.createElement('div');
document.body.appendChild(AppContainer);
const root = createRoot(AppContainer);
root.render(<Hello />);
Unfortunately none of the solutions in this thread worked.
How to import ES6 modules in content script for Chrome Extension