DEV Community

Ersoy
Ersoy

Posted on

Chrome Extension Module Error !

Hello, I am developing a chrome extension with manifest 3. In the first line of the content.js file, I want to access my other javascript files in the project, but I get an import error like this

Uncaught SyntaxError: Cannot use import statement outside a module (at content.js:1:1)

--MY CODES---
================== app.js ====================
const appJs={
last_action:null,
}
export { appJs };

====================== content.js ====================
import { appJs } from './app/scripts/_app.js';

================== manifest.json ==================
"content_scripts": [
{ "matches": [":///*"],
"js": ["content.js"], "type": "module"
}
],

Anyone can help me please ?

Top comments (0)