From 9eee89e8c907e922f7ac9795b2660b5e3f2125cc Mon Sep 17 00:00:00 2001 From: dsgnr Date: Fri, 10 Dec 2021 21:54:34 +0000 Subject: [PATCH] Fix an issue where production was warning in console log due to undefined variable --- CHANGELOG.md | 4 ++++ docker-compose.yml | 2 ++ webui/src/pages/HomePage.js | 2 +- webui/webpack.config.js | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb6c543..d8fff73 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [1.0.9] - 2021-12-10 + +- Resolve console warning about undefined DEFAULT_PORT var in production + ## [1.0.8] - 2021-12-10 - Add dependabot monitoring to repository diff --git a/docker-compose.yml b/docker-compose.yml index f42cd80..b780170 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ services: image: dsgnr/portcheckerio-ui:latest pull_policy: always container_name: portcheckerio + environment: + - DEFAULT_PORT= ports: - 80:80 restart: unless-stopped diff --git a/webui/src/pages/HomePage.js b/webui/src/pages/HomePage.js index 374d615..127ac7f 100644 --- a/webui/src/pages/HomePage.js +++ b/webui/src/pages/HomePage.js @@ -16,7 +16,7 @@ export class HomePage extends Component { portError: "", showResults: false, host: "", - ports: parseInt(process.env.DEFAULT_PORT), + ports: parseInt(process.env.DEFAULT_PORT) || "", results: [], msg: "" }; diff --git a/webui/webpack.config.js b/webui/webpack.config.js index a5ab23f..a1f8d61 100644 --- a/webui/webpack.config.js +++ b/webui/webpack.config.js @@ -75,7 +75,7 @@ module.exports = { }, plugins: [ new webpack.DefinePlugin({ - 'process.env.DEFAULT_PORT': JSON.stringify(process.env.DEFAULT_PORT) || null + 'process.env.DEFAULT_PORT': process.env.DEFAULT_PORT || null }), new HtmlWebpackPlugin({ hash: true,