I have one error that integrate next.js and thirdweb.
That is, if I don’t add ThirdwebProvider, project compile succeed, but if I add ThirdwebProvider, project compile fail.
Who can help me?
This is my code snippet
Here, if I execute with “yarn dev” command, compile fail.
This is executing result
layout.tsx
// layout.tsx
import type { Metadata } from "next";
import { Space_Mono, Work_Sans } from "next/font/google";
import localFont from "next/font/local";
import Footer from "../components/Footer";
import "./globals.css";
import "../css/line-area-chart.css";
import "../css/scatter-time-chart.css";
import { Toaster } from "react-hot-toast";
import IntercomChat from "../components/ui/IntercomChat/IntercomChat.jsx";
import { IntercomProvider } from "../context/IntercomContext";
import { ThirdwebProvider } from "thirdweb/react";
const spacemono = Space_Mono({
subsets: ["latin"],
weight: ["400", "700"],
variable: "--space-mono-font",
});
const worksans = Work_Sans({
subsets: ["latin"],
weight: ["400", "700"],
variable: "--work-sans-font",
});
const suisseintl = localFont({
src: "../public/font/SuisseIntl-Regular.ttf",
variable: "--suisseintl-font",
});
export const metadata: Metadata = {
title: "Prismatic Capital",
description:
"Prismatic Capital is a cryptoasset investment firm. We invest in the entire spectrum of digital assets, with an emphasis on decentralized finance.",
};
export const revalidate = 3600; // revalidate at most every hour
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" suppressHydrationWarning>
<body
className={`${suisseintl.variable} ${spacemono.variable} ${worksans.variable} font-body`}
>
<div className="relative overflow-hidden">
<ThirdwebProvider>
<IntercomProvider>
{children}
<Toaster />
<IntercomChat />
<Footer />
</IntercomProvider>
</ThirdwebProvider>
</div>
</body>
</html>
);
}
New contributor
MasterAI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.