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
initializeSite,
isAuthPath,
} from "../shared/utils";
-import { VERSION } from "../shared/version";
+
+const { NODE_ENV } = process.env as Record<string, string>;
const server = express();
const [hostname, port] = process.env["LEMMY_UI_HOST"]
}
let routeData = await Promise.all(promises);
+ // let routeData = [{ error: "I am an error, hear me roar!" } as any];
// Redirect to the 404 if there's an API error
if (routeData[0] && routeData[0].error) {
// Exact error should only be seen in a development environment. Users
// in production will get a more generic message.
- if (VERSION === "dev") {
+ if (NODE_ENV === "development") {
errorPageData.error = error;
}
}
}
+ console.log(routeData);
+
const isoData: IsoData = {
path,
site_res: site,
} catch (err) {
console.error(err);
res.statusCode = 500;
- return res.send(VERSION === "dev" ? err.message : "Server error");
+ return res.send(NODE_ENV === "development" ? err.message : "Server error");
}
});
const errorPageData = this.getErrorPageData();
return (
- <div className="container-lg">
+ <div className="container-lg text-center">
<h1>{errorPageData ? "Error!" : "Page Not Found"}</h1>
<p>
{errorPageData
- ? "There was an error on the server. Try refreshing your browser of coming back at a later time"
+ ? 'There was an error on the server. Try refreshing your browser. If that doesn\'t work, come back at a later time. If the problem persists, <a href="https://github.com/LemmyNet/lemmy/issues">consider opening an issue.</a>'
: "The page you are looking for does not exist"}
</p>
{!errorPageData && (
</ul>
</div>
)}
- {errorPageData?.error && <code>{errorPageData.error.message}</code>}
+ {errorPageData?.error && (
+ <code className="text-start">{errorPageData.error}</code>
+ )}
</div>
);
}
export interface ErrorPageData {
type: "error";
- error?: Error;
+ error?: string;
adminMatrixIds?: string[];
}
-export const VERSION = "unknown version" as string;
+export const VERSION = "unknown version";