Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreButton causes Next.js >14: Invalid <Link> with <a> child #1935

Open
1 task done
jan-clockworkwp opened this issue Aug 20, 2024 · 0 comments
Open
1 task done

CoreButton causes Next.js >14: Invalid <Link> with <a> child #1935

jan-clockworkwp opened this issue Aug 20, 2024 · 0 comments
Labels
package: @faustwp/blocks Related to the Faust blocks package type: feature New functionality being added

Comments

@jan-clockworkwp
Copy link

jan-clockworkwp commented Aug 20, 2024

Description

When the CoreButton block is used and the link value is set, Next.js complains about: Invalid <Link> with <a> child. More information about the issue can be found at https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor.

It's essentially the same issue as mentioned here: #1916. I just want to point out that it is still present and that @faustwp/[email protected] could be updated to either add the legacyBehavior flag proposed in the Next.js docs or simply remove the creation of the anchor tag within the CoreButton block. Perhaps it is not safe to assume that Next.js 13 or higher is in use, but even the faust.js example repositories are using Next.js version 14 or higher. If someone chooses to use Next.js version less than 13 with faustjs, they should be aware of the risks and security issues associated with using old packages, and they should probably use @faustwp/blocks package of a version less than 4. The latest @faustwp/blocks package should align with the latest Next.js version and therefore comply with any of the proposed solutions in https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor.

Thank you for considering my proposal for improvement of @faustwp/blocks package.

Steps to reproduce

  1. Set up faust with block support and next.js version >14
  2. Use CoreBlock in the Gut. editor
  3. Give it some url, in my case (https://example.com)
  4. Save post and visit page on the front.

Additional context

No response

@faustwp/core Version

3.0.3

@faustwp/cli Version

3.0.2

FaustWP Plugin Version

1.3.2

WordPress Version

6.5.5

Additional environment details

@faustwp/blocks": "4.0.0"

Please confirm that you have searched existing issues in the repo.

  • Yes
@josephfusco josephfusco added type: feature New functionality being added package: @faustwp/blocks Related to the Faust blocks package labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: @faustwp/blocks Related to the Faust blocks package type: feature New functionality being added
Projects
None yet
Development

No branches or pull requests

2 participants