primefaces / sakai-react

Free React Admin Template
https://sakai.primereact.org
MIT License
898 stars 566 forks source link

Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>. #42

Closed xiongzhend closed 1 year ago

xiongzhend commented 1 year ago

Just git clone from repo and yarn dev, I got this issue:

error - node_modules/next/dist/client/link.js (274:22) @ LinkComponent error - Error: Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>. Learn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor at LinkComponent (webpack-internal:///./node_modules/next/dist/client/link.js:269:23) at renderWithHooks (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5658:16) at renderForwardRef (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5842:18) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6005:11) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderNode (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6259:12) at renderChildrenArray (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6211:7) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6141:7) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderNode (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6259:12) at renderHostElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5642:3) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5952:5) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderForwardRef (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5859:5) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6005:11) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderNode (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6259:12) at renderChildrenArray (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6211:7) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6141:7) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderNode (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6259:12) at renderHostElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5642:3) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5952:5) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderNode (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6259:12) at renderChildrenArray (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6211:7) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6141:7) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5971:9) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderIndeterminateComponent (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5785:7) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5946:7) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderContextProvider (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5920:3) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6017:11) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderIndeterminateComponent (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5785:7) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5946:7) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) at renderNodeDestructive (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6076:14) at renderIndeterminateComponent (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5785:7) at renderElement (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:5946:7) at renderNodeDestructiveImpl (/Users/xiongzhend/Documents/frisbeedog/sakai-react/sakai-js/node_modules/react-dom/cjs/react-dom-server.browser.development.js:6104:11) { page: '/' } null

xiongzhend commented 1 year ago

and when I switch to Sakai-ts, it has some errors in console window like these:

截屏2023-03-21 21 34 53
srdo96 commented 1 year ago

Run this command npx @next/codemod new-link It will resolve the problem. you can read this Next.Js doc for more.

habubey commented 1 year ago

Could you please confirm if this issue is still ongoing? We were unable to see any errors when we started the project with 'yarn dev'. Before you proceed, kindly update your version. If the issue is still ongoing, please let us know and we will reopen this ticket.