Reputation: 31
I'm developing a Chrome extension (Manifest V3) and using ES6 modules in my content script (content.js
). My code starts with:
However, when the extension loads on https://nkiri.com/, I get the following error in the console:
"Uncaught SyntaxError: Cannot use import statement outside a module"
I've tried:
"type": "module"
in my manifest's content_scripts field (Manifest V3), but it still doesn't work.My question is: What is the best approach to use ES6 modules in a Chrome extension content script, and how can I resolve this error?
Environment Details:
Chrome Extension using Manifest V3.
Content script injected into https://nkiri.com/.
Any guidance or examples would be greatly appreciated!
Upvotes: 0
Views: 15