I'm converting my manifest v2 Chrome extension to v3, and getting the error below when I imported a function from another javascript file, to background.js file;
Uncaught SyntaxError: Cannot use import statement outside a module
background.js
import test_123 from './test.js';
test.js
export function test_123()
{
alert('test ok');
}
manifest.js
"background":{
"service_worker": "background.js"
},
I have too many functions in the test.js file, so it's great if there is any way to import the whole test.js at once using something like require('./test.js')
Can anyone please point me in the right direction to identify the issue and solve it?