English 中文(简体)
其次/假设产生一种特性,即无效错误
原标题:Next/image is generating an Element type is invalid error

我试图利用下层/高射线图像。 然而,在我试图这样做的时候,我有以下错误:

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object.

Check the render method of `ImagePage`

图像学源代码:

import React from  react ;
import Image from  next/image ;
import { Paper } from  @mui/material ;

import Img from  ../../images/image.svg ;

const ImagePage = () => {
    return (
        <div>
            <Paper>
                <Image src={Img} />
            </Paper>
        </div>
    );
};

export default ImagePage;

如果我在四舍五入点之间有任何其它部分,我看不到这一错误。 形象的道路是正确的。

难道我能以不同的方式使造成这一错误的形象被抛弃吗?

问题回答

<代码>src属性在图像组成部分中占有显赫价值。 你的消息来源丝毫不错。 然而,你的进口部门是一个物体,而不是一条可能与物体名称或某些保留部件名称相冲突的道路。

因此,你需要提供一种特殊产品,而不是进口物品。 据说

<Image src={`../../images/image.svg`} alt= Icon  width={32} height={32}/>

PS:图像部分要求<代码>alt,widthhal





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签