From 5db57c9cdf81fe801c56cb3e62b3e600d1653e06 Mon Sep 17 00:00:00 2001 From: akash Date: Mon, 3 Nov 2025 17:30:49 +0530 Subject: [PATCH] Console errors are fixed --- pages/_app.js | 20 ++- pages/_document.js | 69 +++++----- ...ent-for-metatroncube-software-solutions.js | 8 +- pages/contact.js | 2 +- pages/faq.js | 2 +- pages/portfolio.js | 19 ++- pages/privacy-policy.js | 4 +- pages/service/app-development-waterloo.js | 2 +- ...chener-waterloo-website-design-services.js | 2 +- .../service/mobile-application-development.js | 2 +- ...fessional-website-designers-in-waterloo.js | 2 +- pages/service/website-development-company.js | 2 +- pages/services-digital-solutions.js | 8 +- src/ConsenHead.js | 118 ++---------------- src/components/AboveFooter.js | 2 +- src/components/BrandSlider.js | 2 +- src/components/Home/AboutSection.js | 13 +- src/components/Home/Banner.js | 16 +-- src/components/Home/Cards.js | 4 +- src/components/Home/CounterSection.js | 2 +- src/components/Home/ServicesSection.js | 2 +- src/components/Home/TestimonialSection.js | 2 +- src/components/HomeContact.js | 2 +- src/components/LogoSlider.js | 16 +-- src/layout/Layout.js | 11 +- src/layout/footer/DefaultFooter.js | 26 ++-- src/layout/footer/Footer1.js | 26 ++-- src/layout/footer/Footer3.js | 26 ++-- src/utils.js | 34 ++++- 29 files changed, 193 insertions(+), 251 deletions(-) diff --git a/pages/_app.js b/pages/_app.js index bcb391f..03b3873 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -11,8 +11,18 @@ const App = ({ Component, pageProps }) => { return () => clearTimeout(timer); }, []); - // ✅ Add accessiBe script useEffect(() => { + if (typeof window === "undefined") return; + + const host = window.location.hostname; + const isLocal = + host === "localhost" || + host === "127.0.0.1" || + host.endsWith(".vercel.app") || + host.endsWith(".netlify.app"); + + if (process.env.NODE_ENV !== "production" || isLocal) return; + const script = document.createElement("script"); script.src = "https://acsbapp.com/apps/app/dist/js/app.js"; script.async = true; @@ -21,9 +31,11 @@ const App = ({ Component, pageProps }) => { window.acsbJS.init(); } }; + document.head.appendChild(script); - const h = document.querySelector("head") || document.body; - h.appendChild(script); + return () => { + script.remove(); + }; }, []); return ( @@ -35,4 +47,4 @@ const App = ({ Component, pageProps }) => { ); }; -export default App; +export default App; \ No newline at end of file diff --git a/pages/_document.js b/pages/_document.js index 812c685..49dae51 100644 --- a/pages/_document.js +++ b/pages/_document.js @@ -1,10 +1,26 @@ -import { Html, Head, Main, NextScript } from 'next/document'; +// pages/_document.js +import { Html, Head, Main, NextScript } from "next/document"; export default function Document() { return ( - {/* ✅ Google Tag Manager (script) */} + {/* ✅ CSS Styles */} + + + + + + + + + + + + + + + {/* ✅ Google Tag Manager */} + {/* ✅ Google Analytics */} +