Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running linux executable throws "Error: Cannot find module 'source-map-support/source-map-support.js'" #3

Closed
bdiz opened this issue Apr 23, 2018 · 6 comments

Comments

@bdiz
Copy link

bdiz commented Apr 23, 2018

Hi, thanks for the plugin. Gets me close.

I'm able to yarn serve:electron with no problem. yarn build:electron seems ok too until I try to run the linux binary. I get Error: Cannot find module 'source-map-support/source-map-support.js'.

I tried yarn add source-map-support and yarn add source-map-support --dev but neither seemed to help.

I've listed my build steps and versions.

Thanks.

$ vue create my-app
> default (babel, eslint)
$ cd my-app
$ vue add electron-builder
$ git checkout -- src/assets/logo.png public/favicon.ico # for whatever reason these files get corrupted
$ yarn serve:electron
# serves just fine.
$ yarn build:electron
yarn run v1.6.0
$ vue-cli-service build:electron
[1] Hash: bd8f7028819f7fd2208712a0941a1e9eb13302b3                                       
Version: webpack 3.11.0
Child
    Hash: bd8f7028819f7fd22087
    Time: 1312ms
          Asset     Size  Chunks             Chunk Names
        main.js  1.43 kB       0  [emitted]  main
    main.js.map  2.08 kB       0  [emitted]  main
       [0] multi ./src/main/index.js 28 bytes {0} [built]
       [1] ./src/main/index.js 1.49 kB {0} [built]
        + 3 hidden modules
Child
    Hash: 12a0941a1e9eb13302b3
    Time: 6717ms
              Asset       Size  Chunks             Chunk Names
        renderer.js     100 kB       0  [emitted]  renderer
         styles.css  381 bytes       0  [emitted]  renderer
    renderer.js.map     142 kB       0  [emitted]  renderer
     styles.css.map   87 bytes       0  [emitted]  renderer
         index.html  335 bytes          [emitted]  
       [1] multi ./node_modules/electron-webpack/vue-renderer-entry.js ./src/main.js 40 bytes {0} [built]
       [3] ./src/main.js + 7 modules 9.26 kB {0} [built]
       [4] ./node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!./node_modules/vue-style-loader!./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{"optionsId":"0","vue":true,"scoped":false,"sourceMap":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 41 bytes {0} [built]
       [6] ./src/assets/logo.png 9.17 kB {0} [built]
       [7] ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{"optionsId":"0","vue":true,"scoped":false,"sourceMap":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 327 bytes [built]
       [9] ./node_modules/vue-style-loader/lib/addStylesClient.js + 1 modules 6.87 kB [built]
        + 5 hidden modules
    Child html-webpack-plugin for "index.html":
         1 asset
           [0] ./node_modules/html-loader?minimize=false!/__virtual__/renderer-index.html 278 bytes {0} [built]
    Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js?minimize!node_modules/vue-loader/lib/style-compiler/index.js?{"optionsId":"0","vue":true,"scoped":false,"sourceMap":false}!node_modules/vue-loader/lib/selector.js?type=styles&index=0!src/App.vue:
           [0] ./node_modules/css-loader?minimize!./node_modules/vue-loader/lib/style-compiler?{"optionsId":"0","vue":true,"scoped":false,"sourceMap":false}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 327 bytes {0} [built]
            + 1 hidden module
    Child extract-text-webpack-plugin node_modules/extract-text-webpack-plugin/dist node_modules/css-loader/index.js?minimize!node_modules/vue-loader/lib/style-compiler/index.js?{"optionsId":"0","vue":true,"id":"data-v-2ebf6f26","scoped":true,"sourceMap":false}!node_modules/vue-loader/lib/selector.js?type=styles&index=0!src/components/HelloWorld.vue:
           2 modules
  • electron-builder version=20.10.0
  • loaded configuration file=package.json ("build" field)
  • loaded parent configuration file=/home/bdiz/dev/my-app/node_modules/electron-webpack/electron-builder.yml
  • description is missed in the package.json appPackageFile=/home/bdiz/dev/my-app/package.json
  • author is missed in the package.json appPackageFile=/home/bdiz/dev/my-app/package.json
  • writing effective config file=dist_electron/electron-builder-effective-config.yaml
  • no native production dependencies
  • packaging       platform=linux arch=x64 electron=1.8.4 appOutDir=dist_electron/linux-unpacked
  • file source doesn't exist from=/home/bdiz/dev/my-app/static
  • building        target=snap arch=x64 file=dist_electron/my-app_0.1.0_amd64.snap
  • building        target=AppImage arch=x64 file=dist_electron/my-app-0.1.0-x86_64.AppImage
  • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
  • application Linux category is set to default "Utility" reason=linux.category is not set and cannot map from macOS docs=https://electron.build/configuration/configuration#LinuxBuildOptions-category
Done in 45.63s.
$ cd dist_electron/linux-unpacked/
$ ./my-app
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'source-map-support/source-map-support.js'
    at Module._resolveFilename (module.js:485:15)
    at Function.Module._resolveFilename (/home/bdiz/dev/my-app/dist_electron/linux-unpacked/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/bdiz/dev/my-app/dist_electron/linux-unpacked/resources/app.asar/main.js:1:156)
    at Object.<anonymous> (/home/bdiz/dev/my-app/dist_electron/linux-unpacked/resources/app.asar/main.js:4:3)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
$ vue --version
3.0.0-beta.6
$ node --version
v8.5.0
$ yarn --version
1.6.0
$ cat package.json
...
  "dependencies": {
    "vue": "^2.5.13"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.0.0-beta.6",
    "@vue/cli-plugin-eslint": "^3.0.0-beta.6",
    "@vue/cli-service": "^3.0.0-beta.6",
    "electron": "^1.8.4",
    "electron-builder": "^20.8.1",
    "electron-webpack": "^1.13.0",
    "vue-cli-plugin-electron-builder": "^0.1.7",
    "vue-template-compiler": "^2.5.13"
  },
...
@kiswa
Copy link

kiswa commented Apr 23, 2018

Same error exists on Windows 10.

@nklayman
Copy link
Owner

I had the same error until adding source-map-support as a (non dev) dependency on Windows 10, and I published a new version that adds it in the generator. I am not sure if this will fix the issue on linux as well, so let me know if it works. Remember to re-invoke the generator after updating to 0.1.8 with vue invoke electron-builder

@kiswa
Copy link

kiswa commented Apr 24, 2018

Works for me on Win10. Haven't tested on Linux yet. @bdiz ?

@bdiz
Copy link
Author

bdiz commented Apr 24, 2018

I can't seem to get by vuejs/vue-cli #1162 in order to verify.

@nklayman
Copy link
Owner

Try using this suggestion (comment).

@bdiz
Copy link
Author

bdiz commented Apr 25, 2018

Thanks @nklayman . That suggestion did the trick as did your fix. Linux executable runs and opens gui with no problem now. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants