我的NextJS应用程序如下:
app/page.js
'use client';
import React from 'react';
export default function Home() {
return (<div>Testing</div>);
}
app/layout.js
export const metadata = {
title: 'Next.js',
description: 'Generated by Next.js',
}
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}
当我运行
next dev
我得到以下错误:
error - node_modules/next/dist/build/webpack/loaders/next-flight-loader/module-proxy.js (56:14) @ Object.get
error - Error: Cannot access default.then on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.
at async Promise.all (index 0)
null
error - node_modules/next/dist/build/webpack/loaders/next-flight-loader/module-proxy.js (56:14) @ Object.get
error - Error: Cannot access default.then on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.
at async Promise.all (index 0)
我找不到任何关于违约的参考资料。有没有办法缩小这个错误?我还没有能够找到这个错误在网络搜索,所以任何关于错误的信息将不胜感激。
1条答案
按热度按时间bxjv4tth1#
如果您使用的是旧版本,则可以使用
13.4.19
或latest
升级next.js版本。Next.js Official docs to upgrade your application