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
After installing local-echo as a node module using npm install, I tried to import local-echo using require within an electron app but encountered this error:
var LocalEchoController = require('local-echo')
Exception thrown in developer console:
Uncaught D:\electron-app\node_modules\local-echo\index.js:1
(function (exports, require, module, __filename, __dirname, process, global, Buffer) { return function (exports, require, module, __filename, __dirname) { import LocalEchoController from "./lib/LocalEchoController";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at new Script (vm.js:84:7)
at createScript (vm.js:258:10)
at Object.runInThisContext (vm.js:306:10)
at Module._compile (internal/modules/cjs/loader.js:884:26)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)
at Module.load (internal/modules/cjs/loader.js:816:32)
at Module._load (internal/modules/cjs/loader.js:728:14)
at Module._load (electron/js2c/asar.js:717:26)
at Function.Module._load (electron/js2c/asar.js:717:26)
at Module.require (internal/modules/cjs/loader.js:853:19)
Can you fix this error? Or at least provide a solution on how to fix this error? Thanks
The text was updated successfully, but these errors were encountered:
Hello, I also encountered a similar problem. Import cannot be used in Es5, and the exception similar to that reported by you cannot be used with require
After installing local-echo as a node module using npm install, I tried to import local-echo using require within an electron app but encountered this error:
var LocalEchoController = require('local-echo')
Exception thrown in developer console:
Can you fix this error? Or at least provide a solution on how to fix this error? Thanks
The text was updated successfully, but these errors were encountered: