You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use a call to chromium browser on startup to initialize webpack/nextjs websockets
- a very confusing thing about development of cocalc due to nextjs *AND*
webpack doing separate hot module reloading for different apps in the
same process is that when you restart the server you have to visit some
nextjs landing page and wait 1-2 minutes for it to compile before
the frontend app works. This commit fixes that by automating it,
as long as you have chromium-browser installed.
constmsg=`Started HUB!\n\n-----------\n\n The following URL *might* work: ${target}\n\n\nPORT=${port}\nBASE_PATH=${basePath}\nPROTOCOL=${protocol}\n\n${
281
280
basePath.length<=1
282
281
? ""
283
282
: "If you are developing cocalc inside of cocalc, take the URL of the host cocalc\nand append "+
@@ -286,6 +285,26 @@ async function startServer(): Promise<void> {
286
285
}\n\n-----------\n\n`;
287
286
winston.info(msg);
288
287
console.log(msg);
288
+
289
+
if(
290
+
program.websocketServer&&
291
+
program.nextServer&&
292
+
process.env["NODE_ENV"]!="production"
293
+
){
294
+
// This is entirely to deal with conflicts between both nextjs and webpack when doing
295
+
// hot module reloading. They fight with each other, and the we -- the developers --
296
+
// win only AFTER the fight is done. So we force the fight automatically, rather than
297
+
// manually, which is confusing.
298
+
console.log(
299
+
`launch get of ${target} so that webpack and nextjs websockets can fight things out`,
0 commit comments