Copium for old Node 18
| @@ -14,7 +14,6 @@ import multer from 'multer'; | |||
| 14 | import responseTime from 'response-time'; | 14 | import responseTime from 'response-time'; |
| 15 | import helmet from 'helmet'; | 15 | import helmet from 'helmet'; |
| 16 | import bodyParser from 'body-parser'; | 16 | import bodyParser from 'body-parser'; |
| 17 | import open, { apps } from 'open'; | ||
| 18 | 17 | ||
| 19 | // local library imports | 18 | // local library imports |
| 20 | import './fetch-patch.js'; | 19 | import './fetch-patch.js'; |
| @@ -329,6 +328,10 @@ async function postSetupTasks(result) { | |||
| 329 | 328 | ||
| 330 | if (cliArgs.browserLaunchEnabled) { | 329 | if (cliArgs.browserLaunchEnabled) { |
| 331 | try { | 330 | 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 | |||
| 332 | function getBrowsers() { | 335 | function getBrowsers() { |
| 333 | const isAndroid = process.platform === 'android'; | 336 | const isAndroid = process.platform === 'android'; |
| 334 | if (isAndroid) { | 337 | if (isAndroid) { |