Skip to content

Commit

Permalink
Fix double registration of byoc components (#1707)
Browse files Browse the repository at this point in the history
* fix double registeration of byoc components

* update changelog
  • Loading branch information
addy-pathania authored Jan 4, 2024
1 parent 0654d14 commit 3508b8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Our versioning strategy is as follows:
* `[sitecore-jss-react]` `[templates/nextjs-xmcloud]` Ensure FEAAS and BYOC components can correctly use item datasources ([#1694](https://github.com/Sitecore/jss/pull/1694))
* `[sitecore-jss-nextjs]` Fix loop error in redirect middleware when the pattern of redirect has default locale. ([#1696](https://github.com/Sitecore/jss/pull/1696))
* `[templates/nextjs-sxa]` Fix feature `show Grid column` in Experience Editor. ([#1704](https://github.com/Sitecore/jss/pull/1704))
* `[templates/nextjs-xmcloud]` Fix double registration of BYOC components ([#1707](https://github.com/Sitecore/jss/pull/1707))

### 🛠 Breaking Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ const feaasPlugin = (nextConfig = {}) => {
// Force use of CommonJS on the server for FEAAS SDK since JSS also uses CommonJS entrypoint to FEAAS SDK.
// This prevents issues arising due to FEAAS SDK's dual CommonJS/ES module support on the server (via conditional exports).
// See https://nodejs.org/api/packages.html#dual-package-hazard.
config.externals = [{ '@sitecore-feaas/clientside/react': 'commonjs @sitecore-feaas/clientside/react' }, ...config.externals];
config.externals = [
{
'@sitecore-feaas/clientside/react': 'commonjs @sitecore-feaas/clientside/react',
'@sitecore/byoc': 'commonjs @sitecore/byoc',
'@sitecore/byoc/react': 'commonjs @sitecore/byoc/react',
...config.externals,
},
];
}

// Overload the Webpack config if it was already overloaded
Expand All @@ -17,7 +24,7 @@ const feaasPlugin = (nextConfig = {}) => {
}

return config;
}
},
});
};

Expand Down

0 comments on commit 3508b8f

Please sign in to comment.