OpenBazaar / openbazaar-desktop

OpenBazaar 2.0 Desktop Client (talks to openbazaar-go server daemon)
MIT License
647 stars 186 forks source link

electron imports are undefined on master and npm start fails on v2.1.1 #1799

Closed aDeveloperCase closed 5 years ago

aDeveloperCase commented 5 years ago

Brief Description: When on master I receive a console error and blank window. When on v2.1.1 I receive errors in the terminal on npm start.

Operating System (OS and version): Ubuntu 18

OpenBazaar version (shown on About OpenBazaar page in menu): openbazaar-desktop: master / v2.1.1 node: 12.4.0 npm: 6.10.3

Hardware: Intel Core i5-4300U CPU @ 1.90GHz x 4, 64-bit

Reproducible (Always / Almost Always / Sometimes / Rarely / Couldn't Reproduce): Always

Steps to reproduce:

  1. on master I did npm i and npm start

  2. the window opens blank with a console error after a while about undefined electron

  3. on v2.1.1 branch I did npm i and npm start

  4. the errors show in the terminal

Observed Behavior: When on master and I run npm start the electron window is built but completely blank and the console log shows always the same error: module x imported from electron is undefined. By default it fails importing screen module in js/startup/index.js (it says something like "cannot read getPrimaryDisplay from undefined screen). But even if I try to wrap it into electron.app.on('ready'... in this case it says app is undefined. So everything imported from electron is undefined. I know a similar error occurs when you try to start electron from node main.js instead of electron main.js.

If I try to switch to the v2.1.1 branch and I do npm install and then npm start I receive the following errors:

npm ERR! Failed at the openbazaar-desktop@2.1.1 sass:build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! Failed at the openbazaar-desktop@2.1.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
jjeffryes commented 5 years ago

I'm not sure what would cause that. I know I've run things successfully on Ubuntu, but only for testing.

Why are you running v2.1.1 instead of the latest code? Just curious.

aDeveloperCase commented 5 years ago

I didn't see there was a greater version. I'll try it tomorrow when I'll have better connection. What OS do you normally use while working on this project? Thanks.

aDeveloperCase commented 5 years ago

Switched to the v2.3.4 everything works fine. Thanks.

jjeffryes commented 5 years ago

@aDeveloperCase glad that worked!

I use both Mac and Windows, the rest of the team uses Mac with a few on Linux, but none of those work on the UI.

Generally we try to make sure it works on stock Ubuntu, but beyond that we don't do much Linux testing, since we're stretched thin and Linux represents a very small percentage of our users.