在我引入了如下代码之后就开始报错
'use client'
import { usePathname } from 'next/navigation';
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
⨯ Error: Unsupported Server Component type: undefined
at stringify (<anonymous>)
at stringify (<anonymous>)
at AsyncLocalStorage.run (node:async_hooks:338:14)
digest: "2792818500"
⚠ Fast Refresh had to perform a full reload due to a runtime error.
我查了解决方案无果,突发奇想重启程序运行一下,报错消失了
可能是和 Next.js 的缓存、热重载有关

被折叠的 条评论
为什么被折叠?



