Describe the Bug
Since upgrading to JSS 22.7 (including nextjs 15 and react 19), what seems to be prefetch calls are returning 404 due to having the locale in the fetch request. These calls are returning a 404:
<domain>/_next/data/<random_characters>/nl-NL/<requested_path>.json?path=<requested_path>
When removing the nl-NL part, it works correctly.
In the [...path] file the resolved url looks like:
/pipe/<random_characters>/_next/data/<random_characters>/nl-NL/<requested_path>.json?path=<requested_path>
props: { notFound } seems to be defined after doing above call, and thus returning a 404 in our [...path]. This does not happen on a hard refresh.
When inspecting the [...path], it looks like after receiving the 404 from the _next/data call, it does a normal call e.g.:
/pipe/<random_characters>/<requested_path>
This call works correctly.
Also, the locale seems te be filled in the context after the upgrade. Prior to the upgrade these were undefined:
context.locale
context.locales
context.defaultLocale
After the upgrade they contain our default locales/and locales set through our next.config.
What I tried:
- Editing the from Next with
locale={false} does not work.
- Disabling prefetching on does not have an effect.
- intercepting in [...path] to remove the locale from the _next/data call return 500's
- removing anything or editing the resolvedUrl etc. in the path returns a 404 or 500.
- Using a custom datafetcher and removing the locale part does not return a 404 in the network console, but returns a 404 on the webpage
In addition, now the resolvedUrl's contain /pipe/<random_characters>/ in the context.resolvedUrl. This was not the case prior to upgrading.
My suspicion is that its related to the locale update, but that does not explain the addition of the /pipe part in the url's.
To Reproduce
Use standard jss starter app 22.9 with default next.config provided by starter app.
Expected Behavior
Possible Fix
Provide environment information
- Sitecore Version: 10.4
- JSS Version: 22.9.1
- NextJS: 15.4.6
- Browser Name and version: chrome, latest
- Operating System and version (desktop or mobile): desktop
- Link to your project (if available):
Describe the Bug
Since upgrading to JSS 22.7 (including nextjs 15 and react 19), what seems to be prefetch calls are returning 404 due to having the locale in the fetch request. These calls are returning a 404:
<domain>/_next/data/<random_characters>/nl-NL/<requested_path>.json?path=<requested_path>When removing the
nl-NLpart, it works correctly.In the
[...path]file the resolved url looks like:/pipe/<random_characters>/_next/data/<random_characters>/nl-NL/<requested_path>.json?path=<requested_path>props: { notFound }seems to be defined after doing above call, and thus returning a 404 in our[...path]. This does not happen on a hard refresh.When inspecting the [...path], it looks like after receiving the 404 from the _next/data call, it does a normal call e.g.:
/pipe/<random_characters>/<requested_path>This call works correctly.
Also, the locale seems te be filled in the context after the upgrade. Prior to the upgrade these were undefined:
After the upgrade they contain our default locales/and locales set through our next.config.
What I tried:
locale={false}does not work.In addition, now the resolvedUrl's contain
/pipe/<random_characters>/in the context.resolvedUrl. This was not the case prior to upgrading.My suspicion is that its related to the locale update, but that does not explain the addition of the
/pipepart in the url's.To Reproduce
Use standard jss starter app 22.9 with default next.config provided by starter app.
Expected Behavior
Possible Fix
Provide environment information