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

NextJS internalLinkMatcher default matches media URLs which causes issues with query strings #1654

Open
mg-aceik opened this issue Nov 7, 2023 · 2 comments
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug stale

Comments

@mg-aceik
Copy link

mg-aceik commented Nov 7, 2023

Describe the Bug

The internalLinkMatcher default matches media URLs which causes issues with query strings

internalLinkMatcher = /^\//g,

To Reproduce

  import {
    Link as JssLink,
  } from '@sitecore-jss/sitecore-jss-nextjs';
  <JssLink field={field}  />

Set the field to be a media link with query params.

Expected Behavior

Logic should not be calling down to NextLink, but it is.

Possible Fix

const internalLinkMatcher = /^\/(?!(-\/media|-\/jssmedia))/;

Provide environment information

  • JSS Version: 21.5.0
@illiakovalenko illiakovalenko added the backlog Issue/PR/discussion is reviewed and added to backlog for the further work label Nov 20, 2023
@illiakovalenko
Copy link
Contributor

@mg-aceik Thank you for submitting your contribution! I've added a ticket containing all the details. It has been added to our internal backlog for thorough review

Copy link

stale bot commented Nov 27, 2024

This has been automatically marked as stale because it has not had recent activity. It will be closed if there is no further activity within 30 days. You may add comments or the 'keep' label to prevent it from closing. Thank you for your contributions.

@stale stale bot added the stale label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug stale
Projects
None yet
Development

No branches or pull requests

2 participants