meowtec / Imagine

🖼️ PNG/JPEG optimization app for macOS, Windows and Linux.
MIT License
3.69k stars 278 forks source link

AppImage fails to launch #86

Closed maxkueng closed 3 years ago

maxkueng commented 3 years ago

Hi. I downloaded the AppImage but I can't launch it.

Version

eg: 0.5.1

Operating system (version and arch)

uname -a
Linux hostanme 5.9.16-1-MANJARO #1 SMP PREEMPT Mon Dec 21 22:00:46 UTC 2020 x86_64 GNU/Linux

Describe the bug

I was trying to launch the AppImage but it crashed immediately saying that it can't find the webpack module which is weird because Webpack is a build tool and shouldn't be required by production code.

chmod +x ./Imagine-0.5.1.AppImage
./Imagine-0.5.1.AppImage

exits with the following error:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'webpack'
Require stack:
- /tmp/.mount_ImaginrfTVf6/resources/app.asar/es/backend/dev.js
- /tmp/.mount_ImaginrfTVf6/resources/app.asar/es/backend/app.js
- /tmp/.mount_ImaginrfTVf6/resources/app.asar/es/bootstrap.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:717:15)
    at Function../lib/common/reset-search-paths.ts.Module._resolveFilename (electron/js2c/browser_init.js:7593:16)
    at Module._load (internal/modules/cjs/loader.js:622:27)
    at Module._load (electron/js2c/asar.js:715:26)
    at Function.Module._load (electron/js2c/asar.js:715:26)
    at Module.require (internal/modules/cjs/loader.js:775:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/tmp/.mount_ImaginrfTVf6/resources/app.asar/es/backend/dev.js:18:21)
    at Module._compile (internal/modules/cjs/loader.js:880:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:892:10)
meowtec commented 3 years ago

Check whether your NODE_ENV has been set to development:

 echo $NODE_ENV
maxkueng commented 3 years ago

@meowtec Thanks! Yes, NODE_ENV is set to development.

NODE_ENV=production ./Imagine-0.5.1.AppImage launches the app successfully.

Awesome, thank you! This is a really cool app! Nice work!

I'll leave this issue open because the AppImage should launch in production mode regardless.