@glad abyss I can't find the testpage I created in the CMS and I can't see the result of console.log when I run the page and try to access my testpage
What coudl the issue be? How can I see console.logs?
import { getAllServices } from "@/lib/fetchData";
import { urlToSlug } from "@/lib/urlToSlug";
import type { PageBuilderProps } from "src/components/pagebuilder";
type AuditCustomer = {
node: {
name: string;
utforteOppdrag: string[];
url: string;
id: string;
};
};
type Page = {
allGranskningskunde: {
edges: AuditCustomer[];
};
content: {
level: number;
url: string;
id: string;
name: string;
sidebygger?: PageBuilderProps[];
};
};
type PageLinks = {
data: {
allTjenester: {
edges: {
node: {
name: string;
url: string;
id: string;
};
}[];
};
};
};
function PageTemplate({ props }: { props: string }) {
console.log("Props er", props);
return <div>Hello world </div>;
}
// This function gets called at build time on server-side.
// It may be called again, on a serverless function, if
// revalidation is enabled and a new request comes in
export async function getStaticProps() {
// const res = await fetch('https://.../posts')
const page = (await getAllServices()) as PageLinks;
console.log("getStaticProps", page);
return {
props: {
page,
},
revalidate: 10, // In seconds
};
}
export async function getStaticPaths() {
const page = (await getAllServices()) as PageLinks;
console.log("getStaticPaths", page);
const paths = page.data.allTjenester.edges.map((page) => ({
params: { slug: urlToSlug(page.node.url) },
}));
return { paths, fallback: "blocking" };
}
export default PageTemplate;