question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extraResources get copied to the wrong folder on Linux/Windows

See original GitHub issue

I am trying to build a .deb, and the folder that I specify in extraResources ends up in the wrong place.

Config:

"build": {
    "app-bundle-id": "apple.app.id",
    "app-category-type": "public.app-category.utilities",
    "productName": "Product",
    "asar": false,
    "extraResources": ["dist/"],
    "osx": {
      "background": "app/assets/bg.jpg",
      "icon": "build/icons/app.icns"
    },
    "linux": {
    }
  },
  "directories": {
    "output": "release"
  },

The intermediate packager output looks like

release/
|-Product-linux-x64/
  |-...
  |-resources/
  |-dist/
  |-...

When I install and run the .deb I electron gives me file not found errors looking for resources/dist/bundle.js and resources/dist/bundle.css.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
GabeIsmancommented, May 11, 2016

Hey @develar, thanks for answering!

I’m building my app with webpack so the distinction between ‘application source code’ and ‘built javascript app’ is important, and I got confused about which corresponded to the electron-builder ‘app’ folder (it’s the built javascript app). So basically I was packaging up my source code and then trying to copy in the actual app 😄.

My working setup now looks like this:

  • src/ folder for my source code (es6) that will be compiled through webpack
  • app/ folder for my static source (main.js, app.html, etc.), built assets (bundle.js, bundle.css, etc), and package.json describing any external app dependencies that can’t be packaged with webpack (native dependencies mostly).
  • build/ folder for electron-builder related assets (icons, etc.)
  • asar turned off since it’s irrelevant when your entire app is ~4 files, and also it breaks ffi.Library

This is a project using a similar setup: https://github.com/xwartz/douban.fm. Would be worth, I think, adding a sentence to the documentation for people with related setups.

2reactions
develarcommented, May 27, 2016

Fix:

  • extraResources must copy files into the same dir where electron app located (app.asar).
  • In addition to extraResources, extraFiles must be added to copy files as extraResources does before with one exception – on OS X into the Contents.

Will be implemented in the next major release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot get to read from extraResources after pack with ...
Im working with a app, that read/write from json files located in the extraResources directory, created ...
Read more >
A file copy operation fails when files or folders have long paths ...
This problem may prevent some files or folders from being copied. You may not realize the the problem occurred if you do not...
Read more >
Building EDuke32 on Linux - EDukeWiki - RTCM
Using the autoload folder : Copy mods or HRP files in the $HOME/.eduke32/autoload folder and it will be automaticaly loaded without additional parameters....
Read more >
releases/gate-7.1-build4485-ALL/doc/tao/index.html - GATE.ac.uk
GATE is open source free software; users can obtain free support from the user and ... data); if you get an error message...
Read more >
https://docs.onapp.com/dd/files/37716003/100884796...
At present OnApp does not support VSs/templates with Active Directory Domain ... You need to delete them manually, otherwise, you will get an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found