小编KUS*_*HAD的帖子

尽管我提供了 src 属性,但 Next.js 图像组件错误 src 丢失

我向 UserCard 提供 src 属性,但随后我也收到以下错误。

错误

Unhandled Runtime Error
Error: Image is missing required "src" property. Make sure you pass "src" in props to the `next/image` component. Received: {"width":50,"height":50}
Run Code Online (Sandbox Code Playgroud)

不同文件中的代码如下

在 UserCard.js 中

Unhandled Runtime Error
Error: Image is missing required "src" property. Make sure you pass "src" in props to the `next/image` component. Received: {"width":50,"height":50}
Run Code Online (Sandbox Code Playgroud)

在阿凡达/Big.js


import Avatar from './Avatar';
import Link from 'next/link';

export default function UserCard({ user, border, onClick }) {
    function handleCloseAll() {
        if (onClick) onClick(); …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs next.js nextjs-image

7
推荐指数
1
解决办法
1万
查看次数

标签 统计

javascript ×1

next.js ×1

nextjs-image ×1

reactjs ×1