NextJS:错误:您无法从服务器组件点入客户端模块。您只能通过导入的名称

lor*_*oku 8 javascript node.js reactjs webpack next.js

我的 NextJS 应用程序如下:

应用程序/page.js

'use client';
import React from 'react';

export default function Home() {
   return (<div>Testing</div>);
}
Run Code Online (Sandbox Code Playgroud)

应用程序/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>
  )
}
Run Code Online (Sandbox Code Playgroud)

当我跑步时

next dev
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

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)
Run Code Online (Sandbox Code Playgroud)

我找不到任何对 default.then 的引用。有什么办法可以缩小这个错误的范围吗?我无法在网络搜索中找到此错误,因此我们将不胜感激有关该错误的任何信息。

Clu*_*erH -3

13.4.19如果您使用的是旧版本,则可以使用或升级您的 next.js 版本latest。这是Next.js 官方文档来升级您的应用程序