Having an 'SyntaxError: Unexpected token 'export' Issue with my Electron-Ionic Application

Issue

//Having this issue and I don’t know how to solve it:

Uncaught C:\Users\Zac\ionic_projects\robot-backup-4\node_modules\@ionic\core\components\index.js:4
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
^^^^^^

SyntaxError: Unexpected token 'export'
    at new Script (vm.js:101:7)
    at createScript (vm.js:262:10)
    at Object.runInThisContext (vm.js:310:10)
    at wrapSafe (internal/modules/cjs/loader.js:979:15)
    at Module._compile (internal/modules/cjs/loader.js:1039:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1113:10)
    at Module.load (internal/modules/cjs/loader.js:940:32)
    at Module._load (internal/modules/cjs/loader.js:781:14)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
    at Function.o._load (electron/js2c/renderer_init.js:29:379)

This is currently effecting all my ionic electron projects that I make. My projects were working fine before I started having this issue.

I tried to get some information but couldn’t find much on the internet. Tried looking at the stencils.config.ts file but couldn’t find it. I also tried upgrading to a different version of stencils.

my epxressjs server isn’t running when I run:
"npx cap open @capacitor-community/electron"

Solution

I figured it out, it turns out it was a module require import that wasn’t supposed to be in my backend server. I’m still fairly new to javascript and react so I wasn’t sure where to find it because the runtime error wasn’t very clear.

Answered By – Zac Rougeau

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published