Copium for old Node 18

c228de06a810d1c0ab7294e29cbf2df7ab6bd14d

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -1Showing whitespace changes
src/server-main.js+4 -1
@@ -14,7 +14,6 @@ import multer from 'multer';
1414import responseTime from 'response-time';
1515import helmet from 'helmet';
1616import bodyParser from 'body-parser';
17-import open, { apps } from 'open';
1817
1918// local library imports
2019import './fetch-patch.js';
@@ -329,6 +328,10 @@ async function postSetupTasks(result) {
329328
330329 if (cliArgs.browserLaunchEnabled) {
331330 try {
331+ // TODO: This should be converted to a regular import when support for Node 18 is dropped
332+ const openModule = await import('open');
333+ const { default: open, apps } = openModule;
334+
332335 function getBrowsers() {
333336 const isAndroid = process.platform === 'android';
334337 if (isAndroid) {