getstation / electron-chrome-extension

Implementation of Chrome extension APIs for Electron
138 stars 26 forks source link

SyntaxError: Cannot use import statement outside a module #68

Closed donutsahoy closed 2 years ago

donutsahoy commented 4 years ago

Trying to import ECx, I have import ECx from 'electron-chrome-extension'; at the top of my main.js and I get a SyntaxError: Cannot use import statement outside a module. I think I'm not doing something correctly but unfortunately I can't figure out what I'm doing wrong.

Thank you!

rtm516 commented 3 years ago

Use this instead

const ECx = require("electron-chrome-extension").default;