Build Error occurred on /fr/500 and /fr/[[...slug]]

System Information
  • Strapi Version: 3.6.5
  • Operating System: MacOS 11.3
  • Database: Postgres 13.1
  • Node Version: 14.0.0
  • NPM Version: 7.19.0
  • Yarn Version: 1.22.4

I’m trying to build my frontend to see if it improves the performance as I’m getting really bad performance scores on Lighthouse but whenever I do I get the errors below. I started with the Strapi Corporate Nextjs demo but have built out on top of it, not using the internationalisation but not changing it. I tried to delete i18n from the admin dashboard and delete some relevant looking files from the frontend and back but just got a cascading array of errors. My client needs this site by the end of the week so if anyone can help me out with this issue I’d be really appreciative. Thanks in advance!

info - Generating static pages (16/16)

Build error occurred
Error: Export encountered errors on following paths:
/fr/500
/fr/[[…slug]]
at /Users/callum/Documents/Coding/normans-website/frontend/node_modules/next/dist/export/index.js:31:1106
at async Span.traceAsyncFn (/Users/callum/Documents/Coding/normans-website/frontend/node_modules/next/dist/telemetry/trace/trace.js:5:584)
at async /Users/callum/Documents/Coding/normans-website/frontend/node_modules/next/dist/build/index.js:43:49
at async Span.traceAsyncFn (/Users/callum/Documents/Coding/normans-website/frontend/node_modules/next/dist/telemetry/trace/trace.js:5:584)
at async /Users/callum/Documents/Coding/normans-website/frontend/node_modules/next/dist/build/index.js:25:1475
at async Span.traceAsyncFn (/Users/callum/Documents/Coding/normans-website/frontend/node_modules/next/dist/telemetry/trace/trace.js:5:584)

Ignore this, I fixed this. Just go to next.config.js and remove “fr” from the locales list, so from this

module.exports = {
i18n: {
locales: [“en”, “fr”],
defaultLocale: “en”,
},
images: {
domains: [‘localhost’],
},
}

to this

module.exports = {
i18n: {
locales: [“en”],
defaultLocale: “en”,
},
images: {
domains: [‘localhost’],
},
}

Please I came across this issue and I dont have locales: [“en”, “fr”], in my next.config.js
what could done to fix this