“React 无法识别 DOM 元素上的 `fetchPriority` 属性。” NextJS 中出现警告?

问题描述 投票:0回答:1

我最近升级到最新版本的 React 和 NextJS 并收到以下错误:

Warning: React does not recognize the `fetchPriority` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `fetchpriority` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    at img
    at eval (webpack-internal:///./node_modules/next/dist/client/image-component.js:136:11)
    at eval (webpack-internal:///./node_modules/next/dist/client/image-component.js:245:47)
    at a
    at LinkComponent (webpack-internal:///./node_modules/next/dist/client/link.js:110:19)


我阅读了 GitHub 存储库上的讨论(https://github.com/vercel/next.js/issues/65161),但唯一的解决方案似乎是安装我不想做的金丝雀版本正在生产中。

在不升级到金丝雀版本的情况下摆脱这个问题的好方法是什么?

reactjs node.js webpack next.js13
1个回答
0
投票

从各个存储库中寻找修复程序,因为问题仅与

jest
有关,目前我使用
--silent
带有玩笑的CLI选项。

所以,测试命令是

npx jest --silent

© www.soinside.com 2019 - 2024. All rights reserved.