Fix error handling in layout server file and add console log in layout svelte file
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
import type { LayoutServerLoad, PageServerLoad } from "./$types";
|
import type { LayoutServerLoad, PageServerLoad } from "./$types";
|
||||||
let USING_VERCEL: string;
|
let USING_VERCEL: string;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
USING_VERCEL = require("$env/static/private").USING_VERCEL;
|
const env = await import("$env/static/private");
|
||||||
} catch (error) {}
|
USING_VERCEL = env.USING_VERCEL;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
export const load: LayoutServerLoad = async (event) => {
|
export const load: LayoutServerLoad = async (event) => {
|
||||||
if (event.locals.user) {
|
if (event.locals.user) {
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
if (data.usingVercel === "true") {
|
if (data.usingVercel === "true") {
|
||||||
inject();
|
inject();
|
||||||
injectSpeedInsights();
|
injectSpeedInsights();
|
||||||
|
} else {
|
||||||
|
console.log("Not using Vercel");
|
||||||
}
|
}
|
||||||
|
|
||||||
let isServerSetup = data.isServerSetup;
|
let isServerSetup = data.isServerSetup;
|
||||||
|
|||||||
Reference in New Issue
Block a user