Error: Could not find the module "/Users/hongwei/all-util-admin-front-react/node_modules/antd/es/index.js@barrel_optimize?names=App,ConfigProvider,theme#theme#darkAlgorithm" in the React Client Manifest. This is probably a bug in the React Server Components bundler.
上面是错误,大概意思是说找不到这个文件,但是我去node_modules中找了下是有这个文件的,那就说明不是这个问题,但是我看控制台打印还有这么一句话。
(node:44880) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use 'node --trace-deprecation ...' to show where the warning was created)
✓ Compiled / in 3.9s (1245 modules)
⨯ at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "85612222"
⨯ at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "85612222"
GET / 500 in 4056ms
✓ Compiled in 224ms (611 modules)
我的pages.tsx是这样的
import React from "react";
import {App, ConfigProvider, theme} from "antd";
const Home = () => (
<ConfigProvider
theme={{
cssVar: true,
algorithm: theme.darkAlgorithm
}}
>
<App />
</ConfigProvider>
);
export default Home;
layout.tsx
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import React from "react";
import {AntdRegistry} from "@ant-design/nextjs-registry";
const inter = Inter({ subsets: ["latin"] });
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
const RootLayout = ({children}: React.PropsWithChildren) => (
<html lang="zh-CN">
<body>
<AntdRegistry>{children}</AntdRegistry>
</body>
</html>
);
export default RootLayout;
目前就这些代码会报Error: Could not find the module "/Users/hongwei/all-util-admin-front-react/node_modules/antd/es/index.js@barrel_optimize?names=App,ConfigProvider,theme#theme#darkAlgorithm" in the React Client Manifest. This is probably a bug in the React Server Components bundler.麻烦帮我看下有什么解决办法吗?