henrikingo / impressionist

A Visual 3D editor for creating stunning impress.js presentations
MIT License
198 stars 37 forks source link

No editing menu displayed on Mac Mojave #19

Open freevie opened 5 years ago

freevie commented 5 years ago

After I run npm start, a blank screen appears. image

I've read from somewhere that this is intended. So, I open the official demo. The demo appears, but I can't see any editing menus at the top. image

Can anyone please help? How can I make the editing menu to be displayed? I am using macOS Mojave (Version 10.14)

henrikingo commented 5 years ago

I don't have Mac myself, so can't test this, but:

The only obvious question is that you need a recent (like last 12-18 months) version of the official demo. (More precisely, 1.0 version or newer of the impress.js file.) These are known to work: https://github.com/henrikingo/impressionist-templates/tree/master/official-demo

Just in case you never saw it work, this is what it should look like: https://youtu.be/c07w0hsC4yQ?t=243

freevie commented 5 years ago

@henrikingo , Thanks for the reply. I ran Electron with the dev mode, and get the following errors when I open a template file.

image

I did try moving the missing files from other folders in to the specified locations, but this results in another error.

henrikingo commented 5 years ago

Ok thanks for this info. I'll look into this.

henrikingo commented 5 years ago

I had the chance to look into this a couple weeks ago. It turns out on Linux this actually works correctly. But based on the information you provided, I know that this is the suspect line: https://github.com/henrikingo/impressionist/blob/5779397daa6b721841996f477b87b596a2a5aa56/main.js#L47

It seems electron does different things for __dirname on different operating systems. The version of electron is quite old. I will try to upgrade impressionist to use the latest version and see if it helps anything.

Thanks for your patience!

UPDATE: This comment is wrong. The errors above are not from __dirname rather those paths use process.resourcesPath as the root of the path.

razvan-mocanu commented 5 years ago

Here is how it worked for me on MacOS Mojave.

Caution, I didn't test if that will break functionality on other platforms!

  1. In main.js:12 add webPreferences: { nodeIntegration: true } so it becomes: mainWindow = new BrowserWindow({ useContentSize: true, icon: './favicon.png', webPreferences: { nodeIntegration: true } }) That will make the 'process' available (https://electronjs.org/docs/api/process).

  2. Then in /src/plugins/loadcss/loadcss.js:10 add "/../.." to the path. So, two levels back.

  3. Same in /src/plugins/tinymce/tinymce.js:78

  4. Optionally you can update electronjs by running in your project root 'npm i -D electron@latest'

paropp commented 5 years ago

same problem on ubuntu 18.04.02: tried last edits. running, but no changes. no editing menu. electron v5.0.2 node v8.10.0 npm 3.5.2

rharper2 commented 5 years ago

Running a beta of MacOS Catalina:

I found I also had to change the path (same, two levels back) in line 1568 and line 1112 of impressionist.js

Oh to save people not familiar with the dev tools looking up how to enable them you add

mainWindow.webContents.openDevTools()

just after the new BrowserWindow on line 12/13 of main.js

Then once you have loaded they slides, you can examine the console to see if it couldn't find the correct resources.

henrikingo commented 5 years ago

Hi

Sorry to keep everyone waiting. While I'm quite excited about the possibilities for Impressionist, I have been prioritizing incoming PRs in impress.js side. After all, that's a widely used and stable project while this is still experimental.

But now it is Summer and I finally do have some time for Impressionist. As a first step I committed upgrade to electron. However, after looking around a bit, it seems to me this is not an electron version issue and if you retry npm start now you will still have the same experience. It seems to me that process.resourcesPath varies on different platforms (and maybe different node versions). I'll work on a solution to just rely on __dirname of main.js file.

That said, feel free to retry and let me know how it goes.

henrikingo commented 5 years ago

Ok. Above commit avoids using process.resourcesPath. Let me know if it helps.

Please also test typing on a slide. I worry that tinymce installation path may not always be the same for everyone.