If one installs dependencies using yarn install --prod (or pnpm install --prod for that matter) yarn build fails. Even though ANALYZE env variable is set to false.
Please check the situation, since it should not be necessary to install devDependencies to production.