Код: Выделить всё
Error occurred prerendering page "/_not-found". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Failed to fetch data
at i.execute (/Users/vishnucr/Projects/mise811-sales/.next/server/app/_not-found/page.js:1:3366)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/vishnucr/Projects/mise811-sales/.next/server/app/_not-found/page.js:1:3955
Export encountered an error on /_not-found/page: /_not-found, exiting the build.
⨯ Static worker exited with code: 1 and signal: null
< /code>
Я нашел, что магазин, созданный для Redux Store, является проблемой, возможно, я сделал это неправильно. Ниже приведена структура приложения. Он использует Assuster.import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import Launch from "./launch";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
children,
}: Readonly) {
return (
{children}
);
}
Код: Выделить всё
import React from "react";
import StoreProvider from "@/lib/store/providers/storeProvider";
interface LaunchProps {
children: React.ReactNode;
}
const Launch = ({ children }: LaunchProps) => {
/* fetch sales and populate */
return {children};
// return children;
};
export default Launch;
Код: Выделить всё
"use client";
import { useRef } from "react";
import { Provider } from "react-redux";
import { makeStore, AppStore } from "@/lib/store/store";
export default function StoreProvider({
children,
}: {
children: React.ReactNode;
}) {
const storeRef = useRef(undefined);
if (!storeRef.current) {
// Create the store instance the first time this renders
storeRef.current = makeStore();
}
return
{children};
}
Что я здесь делаю неправильно , это то, как магазин должен использоваться в NextJs?
Подробнее здесь: https://stackoverflow.com/questions/794 ... -installed
Мобильная версия