Skip to content
This repository has been archived by the owner on Oct 26, 2019. It is now read-only.

Superkit works like a charm in dev, but not when compiled #6

Open
akovalyov opened this issue Oct 18, 2015 · 4 comments
Open

Superkit works like a charm in dev, but not when compiled #6

akovalyov opened this issue Oct 18, 2015 · 4 comments

Comments

@akovalyov
Copy link

Thank you @aluxian for great kit.
Works like a charm in dev.
However, when it is packed to production-ready package and it is installed, the following exception is thrown:

A JavaScript error occurred in the main process
Uncaught Exception:
TypeError: content.charCodeAt is not a function

```     at stripBOM (module.js:442:15)
    at Object.Module._extensions..js (module.js:452:19)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/var/www/github/aluxian/electron-superkit/dist/opt/superkit/resources/app.asar/node_modules/babel-runtime/node_modules/core-js/library/fn/promise.js:1:80)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)

I assume, that it is somehow related to .asar packaging, because if I comment https://github.com/Aluxian/electron-superkit/blob/master/tasks/pack.coffee#L103-L109, the app is compiled and works correctly on Linux and Mac.
Thanks in advance.

@aluxian
Copy link
Owner

aluxian commented Oct 18, 2015

That looks... tricky. Try to update babel. You could disable asar packaging, but on Windows your app might not work due to the 255 path length limit.

@chrisesler
Copy link

I had the same issue, seems to be an issue with Asar+Babel. I ended up just ripping out Babel and moving over to Rollup. Works better with asar.

@akovalyov
Copy link
Author

Upgrade to Babel 6 + {"presets": ["stage-0", "es2015"]} works with asar.
@aluxian I can submit a PR to fix it, but I'd wait until babel6 is more stable and tested.

@aluxian aluxian reopened this Nov 9, 2015
@aluxian
Copy link
Owner

aluxian commented Nov 9, 2015

Cool, then! I'd like to keep this open so I don't forget about upgrading it.

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

No branches or pull requests

3 participants