Electron-builder: Error: Cannot find module 'source-map-support/register'

Created on 18 Sep 2017  路  4Comments  路  Source: electron-userland/electron-builder


  • Version:
    electron-builder: 19.27.7

    electron-updater: 2.8.9
  • Target:
    macOS


    I'm trying to add electron auto updater and added electron-updater dependency. Now after building the app using yarn compile && electron-builder (I'm using vue electron), I keep getting a window with the following error when trying to run the app:
A JavaScript error occurred in the main process

Uncaught Exception:
Error: Cannot find module 'source-map-support/register'
    at Module._resolveFilename (module.js:470:15)
    at Function.Module._resolveFilename (~/.../build/My.app/Contents/Resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (~/.../build/My.app/Contents/Resources/app.asar/node_modules/electron-updater/src/AppUpdater.ts:12:1)
    at Object.<anonymous> (~/.../build/My.app/Contents/Resources/app.asar/node_modules/electron-updater/out/AppUpdater.js:438:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)

The app runs fine after clicking the OK button. But it is very annoying.

question

Most helpful comment

yarn add source-map-support

All 4 comments

yarn add source-map-support

I should have told you that I already have installed source-map-support.

Please show your electron builder config.

I got it working by installing electron-builder as dev dependency. I was curious why it wasn't working. I had source-map-support installed as a regular non-dev dependency.

Was this page helpful?
0 / 5 - 0 ratings