You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the create-sitecore-jss cli to stand up a starter app, setting the language to 'en' causes a duplicate locale error that causes the site build to fail.
throw new Error(`Specified i18n.locales contains the following duplicate locales:\n` + `${[
^Error: Specified i18n.locales contains the following duplicate locales: en
Each locale should be listed only once.
The source of this error seems to be in packages/create-sitecore-jss/src/templates/nextjs-styleguide/src/lib/next-config/plugins/styleguide.js. The cli defined language is added with templating but there is no filter if the input is 'en'.
This is the file code.
conststyleguidePlugin=(nextConfig={})=>{returnObject.assign({},nextConfig,{i18n: {
...nextConfig.i18n,locales: ['en','<%- language %>'],},});};
To Reproduce
Install the starter template with style guide and define the language as -en.
npx create-sitecore-jss
--templates nextjs,nextjs-sxa,nextjs-styleguide,nextjs-styleguide-tracking
--appName locale-bug-repro
--fetchWith GraphQL
--prerender SSR
--language en
Try building the application, you can use next:dev or one of the sitecore starting scripts.
You will see an error about duplicate locales. When inspecting the /lib/next-config/plugins/styleguide.js file, you will see locales: ['en', 'en'].
Expected Behavior
The language is filtered if 'en'.
Possible Fix
No response
Provide environment information
Sitecore Version:
JSS Version: 21.2.4
Browser Name and version:
Operating System and version (desktop or mobile):
Link to your project (if available):
The text was updated successfully, but these errors were encountered:
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.
Describe the Bug
When using the create-sitecore-jss cli to stand up a starter app, setting the language to 'en' causes a duplicate locale error that causes the site build to fail.
The source of this error seems to be in
packages/create-sitecore-jss/src/templates/nextjs-styleguide/src/lib/next-config/plugins/styleguide.js
. The cli defined language is added with templating but there is no filter if the input is 'en'.This is the file code.
To Reproduce
Install the starter template with style guide and define the language as -en.
Try building the application, you can use next:dev or one of the sitecore starting scripts.
You will see an error about duplicate locales. When inspecting the
/lib/next-config/plugins/styleguide.js
file, you will seelocales: ['en', 'en']
.Expected Behavior
The language is filtered if 'en'.
Possible Fix
No response
Provide environment information
The text was updated successfully, but these errors were encountered: