You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I want to import some functions from other files. src files are built ok, so I can use import in them, but I can't do it in my background.js file. Uncaught SyntaxError: Cannot use import statement outside a module
Could you help me?
The text was updated successfully, but these errors were encountered:
You can't import your src folder functions inside background.js. It is used by extension as background script.
You must use Chrome messaging API to send and receive data.
I already used it in background.js to send message when user click extension icon and then received it in content.js to toggle the extension. Similarly you can send message to background.js from src folder.
Let me know if you need more help. Also if you haven't read this article then go through it. Here I have explained in detail how things are working in this repo.
Hello!
I want to import some functions from other files. src files are built ok, so I can use import in them, but I can't do it in my background.js file.
Uncaught SyntaxError: Cannot use import statement outside a module
Could you help me?
The text was updated successfully, but these errors were encountered: