SpotSpot icon indicating copy to clipboard operation
SpotSpot copied to clipboard

How to compile/package without errors?

Open briantully opened this issue 7 years ago • 12 comments

Hey there Will!

Long time no speak. I hope all is well.

I was wondering if you might have an idea why I am seeing the following error when I try to run yarn make or yarn package?

✔ Checking your system
✔ Resolving Forge Config
We need to package your application before we can make it
✔ Preparing to Package Application for arch: x64
⠸ Compiling ApplicationFailed to compile file: /var/folders/7t/2f8l2q9n289gp4hwwbb8622m0000gn/T/electron-packager/darwin-x64/SpotSpot-darwin-x64/Electron.app/Contents/Resources/app/src/types/global.d.ts
Debug Failure. False expression: Output generation failed
⠼ Compiling ApplicationFailed to compile file: /var/folders/7t/2f8l2q9n289gp4hwwbb8622m0000gn/T/electron-packager/darwin-x64/SpotSpot-darwin-x64/Electron.app/Contents/Resources/app/src/types/spotify-node-applescript.d.ts
Debug Failure. False expression: Output generation failed

briantully avatar Apr 18 '19 22:04 briantully

Hey! I ran "yarn package" command in macOS Terminal and it worked fine for me.

yildiz avatar Apr 21 '19 13:04 yildiz

Hi. Have you updated Node recently? Try deleting the node_modules folder and rerunning yarn.

will-stone avatar Apr 21 '19 15:04 will-stone

Actually yes, I did upgrade node from 8.x to current (11.13.0) last week. I'm guessing there is an incompatibility with current in one of the dependencies. I'm going to try to downgrade node to LTS (10.x) and see if that is any better.

briantully avatar Apr 22 '19 15:04 briantully

No luck. Even after downgrading node to 10.15.3 and removing node_modules and doing a clean install by running yarn, yarn package still gives the error where it cannot transpile/compile the global.d.ts and spotify-node-applescript.d.ts files.

yarn package
yarn run v1.15.2
warning ../../package.json: No license field
$ electron-forge package --platform=darwin --arch=x64
✔ Checking your system
✔ Preparing to Package Application for arch: x64
⠙ Compiling ApplicationFailed to compile file: /var/folders/7t/2f8l2q9n289gp4hwwbb8622m0000gn/T/electron-packager/darwin-x64/SpotSpot-darwin-x64/Electron.app/Contents/Resources/app/src/types/global.d.ts
Debug Failure. False expression: Output generation failed
⠹ Compiling ApplicationFailed to compile file: /var/folders/7t/2f8l2q9n289gp4hwwbb8622m0000gn/T/electron-packager/darwin-x64/SpotSpot-darwin-x64/Electron.app/Contents/Resources/app/src/types/spotify-node-applescript.d.ts
Debug Failure. False expression: Output generation failed
✔ Compiling Application
✔ Preparing native dependencies
✔ Packaging Application
✨  Done in 278.58s.

FYI I'm running Mojave 10.14.4 with the latest Xcode and Xcode CLI tools.

briantully avatar Apr 22 '19 16:04 briantully

Interestingly, yarn start serves the app successfully, so it's just the package/compile process that is failing.

¯\_(ツ)_/¯

briantully avatar Apr 22 '19 17:04 briantully

I think this was down to a corrupt yarn.lock file. @briantully Please pull master and try again.

will-stone avatar May 12 '19 16:05 will-stone

Thanks, @will-stone. I tried that, and am able to get a little further during the app compilation. However, now I see the following error:

Packaging ApplicationWARNING: Code sign failed; please retry manually. Error: No identity found for signing.

Is there some special configuration I need to set?

yarn package
yarn run v1.16.0
warning ../../package.json: No license field
$ electron-forge package --platform=darwin --arch=x64
✔ Checking your system
✔ Preparing to Package Application for arch: x64
✔ Compiling Application
✔ Preparing native dependencies
⠹ Packaging ApplicationWARNING: Code sign failed; please retry manually. Error: No identity found for signing.
✔ Packaging Application
✨  Done in 45.48s.

When launching the packaged output:

A JavaScript error occurred in the main process

Uncaught Exception:
Error: Could not get code signature for running application
    at initUpdater (/Users/brian.tully/Sites/SpotSpot/out/SpotSpot-darwin-x64/SpotSpot.app/Contents/Resources/app/node_modules/update-electron-app/index.js:54:15)
    at App.opts.electron.app.isReady.opts.electron.app.on (/Users/brian.tully/Sites/SpotSpot/out/SpotSpot-darwin-x64/SpotSpot.app/Contents/Resources/app/node_modules/update-electron-app/index.js:33:43)
    at App.emit (events.js:187:15)

briantully avatar May 20 '19 22:05 briantully

You will either need an Apple Developer Account to sign the app or remove this line: https://github.com/will-stone/SpotSpot/blob/master/package.json#L86

will-stone avatar May 21 '19 07:05 will-stone

Thank you! And thanks for saving me $99 😜

briantully avatar May 22 '19 05:05 briantully

Hmm,I'm still having the same error when launching the packaged output. After removing the line at https://github.com/will-stone/SpotSpot/blob/master/package.json#L86 do I also need to delete my yarn.lock and node_modules directory and do a yarn install?

briantully avatar May 23 '19 16:05 briantully

You shouldn't have to. That osxSign key is the only thing that tells Electron Packager to sign the app. It looks like it's still packaging the app. Does the built one not run?

will-stone avatar May 23 '19 16:05 will-stone

yarn start works, but yarn package does not, even after deleting yarn.lock and node_modules and doing a yarn install.

briantully avatar May 23 '19 16:05 briantully