From 400d9e6c151521b8d0ccb95cb89735bbf6db8450 Mon Sep 17 00:00:00 2001 From: acalcutt Date: Sun, 6 Nov 2022 21:05:31 -0500 Subject: [PATCH] Update healthcheck.js fix healthcheck output error: "file:///usr/src/app/src/healthcheck.js:1\nvar http = require(\"http\");\n ^\n\nReferenceError: require is not defined in ES module scope, you can use import instead\nThis file is being treated as an ES module because it has a '.js' file extension and '/usr/src/app/package.json' contains \"type\": \"module\". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.\n at file:///usr/src/app/src/healthcheck.js:1:12\n at ModuleJob.run (node:internal/modules/esm/module_job:193:25)\n at async Promise.all (index 0)\n at async ESMLoader.import (node:internal/modules/esm/loader:526:24)\n at async loadESM (node:internal/process/esm_loader:91:5)\n at async handleMainPromise (node:internal/modules/run_main:65:12)\n" --- src/healthcheck.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/healthcheck.js b/src/healthcheck.js index 775ba03..11d11f9 100644 --- a/src/healthcheck.js +++ b/src/healthcheck.js @@ -1,4 +1,4 @@ -var http = require("http"); +import * as http from 'http'; var options = { timeout: 2000, };