Compare commits
5 Commits
v1.16.1
...
fix/chunk-
| Author | SHA1 | Date | |
|---|---|---|---|
| ede34ab7ce | |||
| 3fac158185 | |||
| 001c8514b5 | |||
| 00a8e3248f | |||
| 9951a357ac |
@@ -167,6 +167,9 @@ jobs:
|
|||||||
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
|
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
|
||||||
|
|
||||||
# Comprehensive Docker purge
|
# Comprehensive Docker purge
|
||||||
|
docker buildx stop || true
|
||||||
|
docker buildx rm -a || true
|
||||||
|
docker rm -fv $(docker ps -aq --filter "ancestor=moby/buildkit") || true
|
||||||
docker system prune -af --volumes
|
docker system prune -af --volumes
|
||||||
docker builder prune -af
|
docker builder prune -af
|
||||||
docker buildx prune -af
|
docker buildx prune -af
|
||||||
@@ -241,8 +244,6 @@ jobs:
|
|||||||
DIRECTUS_URL: ${{ needs.prepare.outputs.directus_url }}
|
DIRECTUS_URL: ${{ needs.prepare.outputs.directus_url }}
|
||||||
DIRECTUS_HOST: cms.${{ needs.prepare.outputs.traefik_host }}
|
DIRECTUS_HOST: cms.${{ needs.prepare.outputs.traefik_host }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Mail
|
# Mail
|
||||||
MAIL_HOST: ${{ secrets.SMTP_HOST || vars.SMTP_HOST }}
|
MAIL_HOST: ${{ secrets.SMTP_HOST || vars.SMTP_HOST }}
|
||||||
MAIL_PORT: ${{ secrets.SMTP_PORT || vars.SMTP_PORT || '587' }}
|
MAIL_PORT: ${{ secrets.SMTP_PORT || vars.SMTP_PORT || '587' }}
|
||||||
|
|||||||
@@ -15,6 +15,22 @@ export default function Error({
|
|||||||
// Log the error to Sentry/GlitchTip
|
// Log the error to Sentry/GlitchTip
|
||||||
Sentry.captureException(error);
|
Sentry.captureException(error);
|
||||||
console.error("Caught in error.tsx:", error);
|
console.error("Caught in error.tsx:", error);
|
||||||
|
|
||||||
|
// Auto-reload on ChunkLoadError or Server Action errors to fetch the new deployment assets
|
||||||
|
const isChunkLoadError =
|
||||||
|
error.message &&
|
||||||
|
(error.message.includes("ChunkLoadError") ||
|
||||||
|
error.message.includes("Loading chunk") ||
|
||||||
|
error.message.includes("Failed to find Server Action"));
|
||||||
|
|
||||||
|
if (isChunkLoadError) {
|
||||||
|
const lastReload = sessionStorage.getItem("last-chunk-reload");
|
||||||
|
const now = Date.now();
|
||||||
|
if (!lastReload || now - parseInt(lastReload) > 10000) {
|
||||||
|
sessionStorage.setItem("last-chunk-reload", now.toString());
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
}, [error]);
|
}, [error]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import * as Sentry from "@sentry/nextjs";
|
import * as Sentry from "@sentry/nextjs";
|
||||||
import Error from "next/error";
|
|
||||||
import { useEffect } from "react";
|
import { useEffect } from "react";
|
||||||
import { Inter, Newsreader } from "next/font/google";
|
import { Inter, Newsreader } from "next/font/google";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
@@ -23,6 +22,22 @@ export default function GlobalError({
|
|||||||
}) {
|
}) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
Sentry.captureException(error);
|
Sentry.captureException(error);
|
||||||
|
|
||||||
|
// Auto-reload on ChunkLoadError or Server Action errors to fetch the new deployment assets
|
||||||
|
const isChunkLoadError =
|
||||||
|
error.message &&
|
||||||
|
(error.message.includes("ChunkLoadError") ||
|
||||||
|
error.message.includes("Loading chunk") ||
|
||||||
|
error.message.includes("Failed to find Server Action"));
|
||||||
|
|
||||||
|
if (isChunkLoadError) {
|
||||||
|
const lastReload = sessionStorage.getItem("last-chunk-reload");
|
||||||
|
const now = Date.now();
|
||||||
|
if (!lastReload || now - parseInt(lastReload) > 10000) {
|
||||||
|
sessionStorage.setItem("last-chunk-reload", now.toString());
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
}, [error]);
|
}, [error]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -1,28 +1,23 @@
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse, NextRequest } from "next/server";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
export async function GET() {
|
export async function GET(request: NextRequest) {
|
||||||
try {
|
try {
|
||||||
const POSTS_DIR = path.join(process.cwd(), "content/blog");
|
const searchParams = request.nextUrl.searchParams;
|
||||||
let files = [];
|
const pathParam = searchParams.get("path") || "/";
|
||||||
if (fs.existsSync(POSTS_DIR)) {
|
const typeParam =
|
||||||
files = fs.readdirSync(POSTS_DIR);
|
(searchParams.get("type") as "page" | "layout") || "layout";
|
||||||
}
|
|
||||||
|
|
||||||
// Revalidate the two problematic pages
|
// Revalidate the requested path (defaults to entire app via layout)
|
||||||
revalidatePath("/blog/website-as-a-service");
|
revalidatePath(pathParam, typeParam);
|
||||||
revalidatePath("/blog/zero-overhead-agencies");
|
|
||||||
revalidatePath("/blog"); // also bust the blog list cache
|
|
||||||
|
|
||||||
return NextResponse.json({
|
return NextResponse.json({
|
||||||
success: true,
|
success: true,
|
||||||
cwd: process.cwd(),
|
revalidatedPath: pathParam,
|
||||||
postsDir: POSTS_DIR,
|
revalidatedType: typeParam,
|
||||||
postsDirExists: fs.existsSync(POSTS_DIR),
|
message: `Cache revalidated for ${pathParam} (${typeParam})`,
|
||||||
files: files,
|
|
||||||
message: "Cache revalidated for specific paths",
|
|
||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
return NextResponse.json({ success: false, error: err.message });
|
return NextResponse.json({ success: false, error: err.message });
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { useState, useMemo, useEffect, useRef } from "react";
|
import { useState, useMemo, useEffect, useRef } from "react";
|
||||||
import { motion } from "framer-motion";
|
import { motion } from "framer-motion";
|
||||||
import * as confetti from "canvas-confetti";
|
import confetti from "canvas-confetti";
|
||||||
import {
|
import {
|
||||||
Layers,
|
Layers,
|
||||||
BrainCircuit,
|
BrainCircuit,
|
||||||
|
|||||||
Reference in New Issue
Block a user