Open mg-aceik opened 1 month ago
When the @next/bundle-analyzer is installed and configured, building the site gives:
../../node_modules/webpack-bundle-analyzer/lib/analyzer.js Module not found: Can't resolve 'fs' https://nextjs.org/docs/messages/module-not-found Import trace for requested module: ../../node_modules/webpack-bundle-analyzer/lib/viewer.js ../../node_modules/webpack-bundle-analyzer/lib/index.js ../../node_modules/@next/bundle-analyzer/index.js ./next.config.js ./src/core/FEAASScripts/FEAASScripts.tsx ./src/Scripts.tsx ./src/Layout.tsx ./src/pages/500.tsx
npx create-sitecore-jss nextjs,nextjs-sxa,nextjs-multisite,nextjs-xmcloud
npm run build
Site should build successfully.
The issue is due to https://github.com/Sitecore/jss/blob/8c23ac3af2341d0115268349581891fd9d049ebd/packages/create-sitecore-jss/src/templates/nextjs-xmcloud/src/components/FEAASScripts.tsx#L3 - import nextConfig from 'next.config';
If this import and its usages are commented out, then the error goes away, however of course this will possibly break the FEAAS functionality.
@mg-aceik Thank you for submitting this ticket! I've added a ticket containing all the details to our internal backlog for thorough review
Describe the Bug
When the @next/bundle-analyzer is installed and configured, building the site gives:
To Reproduce
npx create-sitecore-jss nextjs,nextjs-sxa,nextjs-multisite,nextjs-xmcloud
npm run build
Expected Behavior
Site should build successfully.
Possible Fix
The issue is due to https://github.com/Sitecore/jss/blob/8c23ac3af2341d0115268349581891fd9d049ebd/packages/create-sitecore-jss/src/templates/nextjs-xmcloud/src/components/FEAASScripts.tsx#L3 - import nextConfig from 'next.config';
If this import and its usages are commented out, then the error goes away, however of course this will possibly break the FEAAS functionality.
Provide environment information