简体   繁体   English

如何判断此错误来自哪个文件?

[英]How do I tell what file this error is coming from?

I'm somewhat new to next.js and I'm getting this error.我对 next.js 有点陌生,我收到了这个错误。 I've looked at every <a> tag I have in all my files and they all have a corresponding closing </a> tag.我查看了所有文件中的每个<a>标记,它们都有相应的结束</a>标记。 Am I not understanding this error properly?我没有正确理解这个错误吗? The only other thing I can think of is they want all my <a> tags to be wrapped inside of a <div> but I don't know why that would be required.我能想到的唯一另一件事是他们希望我所有的<a>标签都包含在<div>中,但我不知道为什么需要这样做。

Error: Warning: Expected server HTML to contain a matching <a> in <div> .错误:警告:预期服务器 HTML 在<div>中包含匹配的<a>
react-dom.development.js?ac89:67

Also where is this error being thrown from because they only reference they give is to a react-dom file that I think gets generated when next converts my code to something the browser can read (not 100% sure that's what the file is though)另外,这个错误是从哪里抛出的,因为他们只引用他们给出的是一个 react-dom 文件,我认为该文件是在下一次将我的代码转换为浏览器可以读取的内容时生成的(虽然不是 100% 确定文件是什么)

screenshot of error inside chrome dev tools console chrome 开发工具控制台中的错误截图

You can follow the DOM from `MyApp > App > Div > Navbar > Div > Link > a您可以从 `MyApp > App > Div > Navbar > Div > Link > a 跟随 DOM

I had this error.我有这个错误。 You need to wrap your Image in an tag so it looks like this您需要将图像包装在标签中,使其看起来像这样

<Link>
    <a>
        <Image>
    </a>
</Link>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当表格的数据来自上传文件时,如何将表格拆分为两个不同的页面? - How do I split a table in two different pages when the data of the table is coming from uploading a file? 在尝试模拟 localStorage 时,如何处理来自 Test in react 的 JSON.parse 错误? - How do I deal with a JSON.parse error coming from a Test in react when trying to mock localStorage? 如何解决来自我没有创建的文件的“user.getIdToken() 不是函数”错误 - how to solve "user.getIdToken() is not a function" error coming from a file I didn't create TypeScript 错误 7053 - 创建一个使用 prop 覆盖样式的自定义 React 组件,我如何正确告诉 TS 类型是什么? - TypeScript Error 7053 - Creating a custom React component that overrides styles with a prop, how do I properly tell TS what the type is? 如何提取Node.js中来自SQL的结果 - How do I extract results coming from sql in Nodejs 我如何socket.emit()来自函数的数据? - How do I socket.emit() data that is coming from a function? 如何使用 ejs 循环来自后端的变量 - How do I loop a variable coming from the backend using ejs 如何确定此javascript的来源? - How do I determine where this javascript is coming from? 如何检测回来的页面显示? - How do I detect that a page is shown from coming back? 如何限制从阿尔及利亚返回的结果属性? - How do I limit the result attributes coming back from algolia?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM