ENV npm_config_target_arch=x64\r
ENV npm_config_target_platform=linux\r
ENV npm_config_target_libc=musl\r
-ENV NODE_ENV=production\r
\r
# Cache deps\r
COPY package.json yarn.lock ./\r
ENV npm_config_target_arch=x64\r
ENV npm_config_target_platform=linux\r
ENV npm_config_target_libc=musl\r
-ENV NODE_ENV=development\r
\r
# Cache deps\r
COPY package.json yarn.lock ./\r
"isomorphic-cookie": "^1.2.4",
"jwt-decode": "^3.1.2",
"lemmy-js-client": "0.17.2-rc.15",
+ "lodash": "^4.17.21",
"markdown-it": "^13.0.1",
"markdown-it-container": "^3.0.0",
"markdown-it-emoji": "^2.0.2",
"sass": "^1.62.1",
"sass-loader": "^13.2.2",
"serialize-javascript": "^6.0.1",
+ "service-worker-webpack": "^1.0.0",
"sharp": "^0.32.1",
"tippy.js": "^6.3.7",
"toastify-js": "^1.12.0",
"prettier-plugin-organize-imports": "^3.2.2",
"prettier-plugin-packagejson": "^2.4.3",
"rimraf": "^5.0.0",
- "service-worker-webpack": "^1.0.0",
"sortpack": "^2.3.4",
"style-loader": "^3.3.2",
"terser": "^5.17.3",
isAuthPath,
} from "../shared/utils";
-const { NODE_ENV } = process.env as Record<string, string>;
-
const server = express();
const [hostname, port] = process.env["LEMMY_UI_HOST"]
? process.env["LEMMY_UI_HOST"].split(":")
const isoData: IsoDataOptionalSite = {
path,
site_res: site,
- routeData,
+ routeData: getErrorRouteData("lel", site),
};
const wrapper = (
// If an error is caught here, the error page couldn't even be rendered
console.error(err);
res.statusCode = 500;
- return res.send(NODE_ENV === "development" ? err.message : "Server error");
+ return res.send(
+ process.env.NODE_ENV === "development" ? err.message : "Server error"
+ );
}
});
function getErrorRouteData(error: string, site?: GetSiteResponse) {
const errorPageData: ErrorPageData = { type: "error" };
+ console.log(`Error: ${process.env.NODE_ENV}`);
+
// Exact error should only be seen in a development environment. Users
// in production will get a more generic message.
- if (NODE_ENV === "development") {
+ if (process.env.NODE_ENV === "development") {
errorPageData.error = error;
}
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
integrity sha512-9mDDwqVIma6OZX79ZlDACZl8sBm0TEnkf99zV3iMA4GzkIT/9hiqP5mY0HoT1iNLCrKc/R1HByV+yJfRWVJryQ==
-lodash@^4.17.20:
+lodash@^4.17.20, lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==