Skip to content

Build your personal knowledge base with Trilium Notes

fix electron dep issue in the server version, closes #784

zadam7a416b107b0b
diff --git a/Dockerfile b/Dockerfile
index eaef06ef22..d6afebe95e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM node:12.13.1-alpine
+FROM node:12.14.0-alpine
# Create app directory
WORKDIR /usr/src/app
diff --git a/bin/build-server.sh b/bin/build-server.sh
index 1fa6e0b8dd..b46121dc72 100755
--- a/bin/build-server.sh
+++ b/bin/build-server.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
PKG_DIR=dist/trilium-linux-x64-server
-NODE_VERSION=12.13.1
+NODE_VERSION=12.14.0
if [ "$1" != "DONTCOPY" ]
then
diff --git a/src/services/window.js b/src/services/window.js
index 955e8c51d6..f7fed72567 100644
--- a/src/services/window.js
+++ b/src/services/window.js
@@ -1,10 +1,8 @@
-const {BrowserWindow} = require('electron');
const path = require('path');
const url = require("url");
const port = require('./port');
const optionService = require('./options');
const env = require('./env');
-const windowStateKeeper = require('electron-window-state');
// Prevent window being garbage collected
/** @type {Electron.BrowserWindow} */
@@ -13,12 +11,15 @@ let mainWindow;
let setupWindow;
async function createMainWindow() {
+ const windowStateKeeper = require('electron-window-state'); // should not be statically imported
+
const mainWindowState = windowStateKeeper({
// default window width & height so it's usable on 1600 * 900 display (including some extra panels etc.)
defaultWidth: 1200,
defaultHeight: 800
});
+ const {BrowserWindow} = require('electron'); // should not be statically imported
mainWindow = new BrowserWindow({
x: mainWindowState.x,
y: mainWindowState.y,
@@ -61,6 +62,7 @@ function getIcon() {
}
async function createSetupWindow() {
+ const {BrowserWindow} = require('electron'); // should not be statically imported
setupWindow = new BrowserWindow({
width: 800,
height: 800,