-
Notifications
You must be signed in to change notification settings - Fork 419
Fix Vite import resolution using index.jsx barrel files #2713
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,62 @@ | ||
| import React from "react"; | ||
| import { Route, Routes, Navigate } from "react-router-dom"; | ||
| import { AuthProvider } from "./context/AuthContext"; | ||
| import { Helmet } from "react-helmet-async"; | ||
|
|
||
| import Home from "./User/pages/Home"; | ||
| import UserAuth from "./User/pages/UserAuth"; | ||
| import Privacy from "./User/pages/Privacy-Policy"; | ||
| import TermsAndConditions from "./User/pages/TermsAndCondition"; | ||
|
|
||
|
|
||
| // User pages (FIXED IMPORTS) | ||
| import UserAuth from "./User/pages/UserAuth"; | ||
| import AboutUs from "./User/pages/AboutUs"; | ||
| import Contributors from "./User/pages/Contributors"; | ||
| import Contact from "./User/pages/Contacts"; | ||
| import Dashboard from "./User/pages/Dashboard"; | ||
| import Home from "./User/pages/Home"; | ||
| import Privacy from "./User/pages/Privacy-Policy"; | ||
| import TermsAndConditions from "./User/pages/TermsAndCondition"; | ||
| import Help from "./User/pages/Help"; | ||
| import MeetTheMakers from "./User/pages/MeetTheMakers"; | ||
| import FAQ from "./User/pages/FAQ"; | ||
| import CareerPage from "./User/pages/Career-Page"; | ||
| import ServicePage from "./User/pages/Service-Page"; | ||
| import Shipping from "./User/pages/Shipping"; | ||
| import GiftCard from "./User/pages/Gift-Card"; | ||
| import Payment_Policy from "./User/pages/Payment-Policy"; | ||
| import Certification from "./User/pages/Certification"; | ||
| import ReturnAndCancellation from "./User/pages/ReturnAndCancellation"; | ||
| import EPR_Page from "./User/pages/EPRPage"; | ||
|
|
||
| // User components | ||
| import UserAuth from "./User/pages/UserAuth/UserAuth"; | ||
| import AboutUs from "./User/pages/AboutUs/Aboutus.jsx"; | ||
| import Contributors from "./User/pages/Contributors/Contributors.jsx"; | ||
| import Contact from "./User/pages/Contacts/Contact"; | ||
| import Dashboard from "./User/pages/Dashboard/Dashboard"; | ||
| import Home from "./User/pages/Home/Home"; | ||
| // Layouts & shared | ||
| import UserLayout from "./User/UserLayout"; | ||
| import Team from "./User/components/Team/Team"; | ||
| import Confirmation from "./User/pages/Confirmation/Confirmation"; | ||
| import Cancellation from "./User/pages/Cancellation/Cancellation"; | ||
| import Error from "./User/pages/404-Page/Error"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's check the App.jsx file structure and size
wc -l src/App.jsxRepository: codervivek5/VigyBag Length of output: 78 🏁 Script executed: # Read the relevant sections around line 36 and 161
cat -n src/App.jsx | sed -n '30,42p'Repository: codervivek5/VigyBag Length of output: 650 🏁 Script executed: # Read around line 161
cat -n src/App.jsx | sed -n '155,167p'Repository: codervivek5/VigyBag Length of output: 657 🏁 Script executed: # Check for Biome configuration
fd -type f \( -name "biome.json" -o -name ".biomerc*" -o -name "biome.toml" \)Repository: codervivek5/VigyBag Length of output: 233 🏁 Script executed: # Search for all Error usages in App.jsx
rg "Error" src/App.jsx -nRepository: codervivek5/VigyBag Length of output: 167 🏁 Script executed: # Search for Biome configuration files with correct approach
find . -maxdepth 2 -type f \( -name "biome.json" -o -name "biome.toml" -o -name ".biomerc.json" \) 2>/dev/nullRepository: codervivek5/VigyBag Length of output: 75 🏁 Script executed: # Also check for eslint or other linting configs that might mention this
find . -maxdepth 2 -type f \( -name ".eslintrc*" -o -name "eslint.config.*" \) 2>/dev/nullRepository: codervivek5/VigyBag Length of output: 78 🏁 Script executed: # Check if Error is referenced anywhere else in App.jsx to ensure the fix is complete
rg "Error" src/App.jsx -A 2 -B 2Repository: codervivek5/VigyBag Length of output: 319 🏁 Script executed: # Check if the Error component file exists
find . -path "*/User/pages/404-Page/Error*" -type fRepository: codervivek5/VigyBag Length of output: 98 🏁 Script executed: # Read the Biome configuration to check if Error is restricted
cat biome.jsonRepository: codervivek5/VigyBag Length of output: 1838 🏁 Script executed: # Also check the content of Error.jsx to understand what it is
cat -n src/User/pages/404-Page/Error.jsx | head -20Repository: codervivek5/VigyBag Length of output: 1001 Rename the Error import to avoid shadowing the global Error. Biome flags 🛠️ Suggested fix-import Error from "./User/pages/404-Page/Error";
+import ErrorPage from "./User/pages/404-Page/Error";
@@
- <Route path="*" element={<Error />} />
+ <Route path="*" element={<ErrorPage />} />Also applies to: 161-161 🧰 Tools🪛 Biome (2.3.13)[error] 36-36: Do not shadow the global "Error" property. Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global. (lint/suspicious/noShadowRestrictedNames) 🤖 Prompt for AI Agents
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also take a look at this one issue
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: Length of output: 4865
Issues Found:
Recommended fixes:Remove duplicate imports (lines 6-9): -import Home from "./User/pages/Home";
-import UserAuth from "./User/pages/UserAuth";
-import Privacy from "./User/pages/Privacy-Policy";
-import TermsAndConditions from "./User/pages/TermsAndCondition";
-
// User pages (FIXED IMPORTS)Remove unused imports: -import Certification from "./User/pages/Certification";
import ReturnAndCancellation from "./User/pages/ReturnAndCancellation";
-import Team from "./User/components/Team/Team";
import Error from "./User/pages/404-Page/Error";Rename Error to ErrorPage: -import Error from "./User/pages/404-Page/Error";
+import ErrorPage from "./User/pages/404-Page/Error";- <Route path="*" element={<Error />} />
+ <Route path="*" element={<ErrorPage />} />These changes will clean up the imports and resolve the linting issues. 🧬 Code Graph Analysis Results
|
||
| import PrivateRoute from "./PrivateRoute"; | ||
|
|
||
| // Orders | ||
| import OrderDetails from "./User/pages/Order/Orderdetails"; | ||
| import MyOrders from "./User/pages/Order/MyOrders"; | ||
| import DashboardOrders from "./User/pages/Dashboard/dashboard-order"; | ||
| import DashboardCart from "./User/pages/Dashboard/dashboard-cart"; | ||
| import DashboardWishlist from "./User/pages/Dashboard/dashboard-wishlist"; | ||
| import Checkout from "./User/pages/Order/Checkout"; | ||
| import Cart from "./User/pages/Order/Cart"; | ||
| import Wishlist from "./User/pages/Order/Wishlist"; | ||
| import Error from "./User/pages/404-Page/Error"; | ||
| import ProductDetails from "./User/components/Products/ProductDetails"; | ||
| import Help from "./User/pages/Help/Help"; | ||
| import Privacy from "./User/pages/Privacy-Policy/Privacy"; | ||
| import Payment from "./User/pages/Payment/Payment"; | ||
| import MeetTheMakers from "./User/pages/MeetTheMakers/MeetTheMakers.jsx"; | ||
| import Confirmation from "./User/pages/Confirmation"; | ||
| import Cancellation from "./User/pages/Cancellation"; | ||
|
|
||
| import ReturnAndCancellation from "./User/pages/ReturnAndCancellation/returnAndCancellation"; | ||
| import EPR_Page from "./User/pages/EPRPage/EPR_Page"; | ||
| import FAQ from "./User/pages/FAQ/Faq"; | ||
| import PrivateRoute from "./PrivateRoute"; | ||
| import TermsAndConditions from "./User/pages/TermsAndCondition/TermsAndCondition"; | ||
| // import FeedbackButton from "./User/components/FeedbackForm/FeedBtn"; | ||
| import FeedbackModal from "./User/components/FeedbackForm/Feedback"; | ||
| // Dashboard extras | ||
| import DashboardOrders from "./User/pages/Dashboard/dashboard-order"; | ||
| import DashboardCart from "./User/pages/Dashboard/dashboard-cart"; | ||
| import DashboardWishlist from "./User/pages/Dashboard/dashboard-wishlist"; | ||
| import NotificationPage from "./User/pages/Dashboard/NotificationPage"; | ||
| import ProfilePage from "./User/pages/Dashboard/ProfilePage"; | ||
| import CareerPage from "./User/pages/Career-Page/careerPage.jsx"; | ||
| import ServicePage from "./User/pages/Service-Page/service.jsx"; | ||
| import Shipping from "./User/pages/Shipping/shipping"; | ||
| import GiftCard from "./User/pages/Gift-Card/gift-card.jsx"; | ||
| import Payment_Policy from "./User/pages/Payment-Policy/payment-policy.jsx"; | ||
| import Certification from "./User/pages/Certification/Certification.jsx"; | ||
| // Admin components | ||
| import AdminVerificationPage from "./User/pages/Admin-Verification/Admin.jsx"; | ||
| import AdminLayout from "./Admin/AdminLayout"; | ||
| import AdminLogin from "./Admin/Pages/AdminLogin"; | ||
| import VigyForm from "./Admin/Pages/VigyForm"; | ||
| import AdminPanel from "./Admin/Pages/AdminPanel"; | ||
| import ProductForm from "./Admin/Pages/ProductForm"; | ||
|
|
||
| // Latest In Market | ||
| import LatestInMarket from "./User/pages/Latest_in_the_Market/LatestInMarket"; | ||
| // Products | ||
| import ProductDetails from "./User/components/Products/ProductDetails"; | ||
|
|
||
| // Latest in Market | ||
| import LatestInMarket from "./User/pages/Latest_in_the_Market"; | ||
| import HandMadeSoaps from "./User/pages/Latest_in_the_Market/HandMadeSoaps"; | ||
| import ArtSupplies from "./User/pages/Latest_in_the_Market/ArtSupplies"; | ||
| import CeramicDinnerware from "./User/pages/Latest_in_the_Market/CeramicDinnerware"; | ||
|
|
@@ -61,10 +65,9 @@ import StorageBaskets from "./User/pages/Latest_in_the_Market/StorageBaskets"; | |
| import OrganicSoaps from "./User/pages/Latest_in_the_Market/OrganicSoaps"; | ||
| import OrganicTea from "./User/pages/Latest_in_the_Market/OrganicTea"; | ||
| import NaturalCosmetics from "./User/pages/Latest_in_the_Market/NaturalCosmetics"; | ||
| import ForgotPasswordForm from "./User/pages/ForgotPasswordForm"; | ||
|
|
||
| // Popular Categories | ||
| import PopularCategories from "./User/pages/Popular_Categories/Popular_Categories"; | ||
| import PopularCategories from "./User/pages/Popular_Categories"; | ||
| import BeautyWellness from "./User/pages/Popular_Categories/Beauty-Wellness"; | ||
| import BodyCare from "./User/pages/Popular_Categories/Body-Care"; | ||
| import CustomizedGifts from "./User/pages/Popular_Categories/Customized-Gifts"; | ||
|
|
@@ -74,217 +77,99 @@ import FurnitureDecor from "./User/pages/Popular_Categories/Furniture-Decor"; | |
| import HealthSupplements from "./User/pages/Popular_Categories/Health-Supplements"; | ||
| import PrintingStationery from "./User/pages/Popular_Categories/Printing-Stationery"; | ||
|
|
||
| import { Helmet } from "react-helmet-async"; | ||
|
|
||
| // Additional pages | ||
| import Blog from "./User/pages/Blog/Blog.jsx"; | ||
| import GiftcardPage from "./User/pages/AdditionalPages/GiftCardPage"; | ||
| import Sponsorships from "./User/pages/Sponsorships/Sponsorships"; | ||
| import Warranty from "./User/pages/Warranty/Warranty"; | ||
| import ProductCare from "./User/pages/ProductCare/ProductCare"; | ||
| import Subscription from "./User/pages/Subscription/Subscription"; | ||
| import Events from "./User/pages/Events/Events"; | ||
| // Admin | ||
| import AdminVerificationPage from "./User/pages/Admin-Verification"; | ||
| import AdminLayout from "./Admin/AdminLayout"; | ||
| import AdminLogin from "./Admin/Pages/AdminLogin"; | ||
| import VigyForm from "./Admin/Pages/VigyForm"; | ||
| import AdminPanel from "./Admin/Pages/AdminPanel"; | ||
| import ProductForm from "./Admin/Pages/ProductForm"; | ||
|
|
||
| export default function App() { | ||
| return ( | ||
| <AuthProvider> | ||
| <Helmet> | ||
| {/* Botpress chatbot script */} | ||
| <script src="https://cdn.botpress.cloud/webchat/v2/inject.js"></script> | ||
| <script src="https://mediafiles.botpress.cloud/f910a06e-f7d4-4424-8642-e3cdffe933b5/webchat/v2/config.js"></script> | ||
| </Helmet> | ||
|
|
||
| <Routes> | ||
| {/* User routes */} | ||
| <Route path="/" element={<UserLayout />}> | ||
| <Route index element={<Home />} /> {/* Home page route */} | ||
| {/* Latest in the Market routes */} | ||
| <Route index element={<Home />} /> | ||
|
|
||
| {/* Latest in Market */} | ||
| <Route path="latestInMarket" element={<LatestInMarket />} /> | ||
| <Route | ||
| path="latestInMarket/handMadeSoaps" | ||
| element={<HandMadeSoaps />} | ||
| /> | ||
| <Route path="latestInMarket/handMadeSoaps" element={<HandMadeSoaps />} /> | ||
| <Route path="latestInMarket/artSupplies" element={<ArtSupplies />} /> | ||
| <Route | ||
| path="latestInMarket/ceramicDinnerware" | ||
| element={<CeramicDinnerware />} | ||
| /> | ||
| <Route | ||
| path="latestInMarket/bambooProducts" | ||
| element={<BambooProducts />} | ||
| /> | ||
| <Route | ||
| path="latestInMarket/storageBaskets" | ||
| element={<StorageBaskets />} | ||
| /> | ||
| <Route | ||
| path="auth/success" | ||
| element={<StorageBaskets />} | ||
| /> | ||
| <Route | ||
| path="latestInMarket/organicSoaps" | ||
| element={<OrganicSoaps />} | ||
| /> | ||
| <Route path="latestInMarket/ceramicDinnerware" element={<CeramicDinnerware />} /> | ||
| <Route path="latestInMarket/bambooProducts" element={<BambooProducts />} /> | ||
| <Route path="latestInMarket/storageBaskets" element={<StorageBaskets />} /> | ||
| <Route path="latestInMarket/organicSoaps" element={<OrganicSoaps />} /> | ||
| <Route path="latestInMarket/organicTea" element={<OrganicTea />} /> | ||
| <Route | ||
| path="latestInMarket/naturalCosmetics" | ||
| element={<NaturalCosmetics />} | ||
| /> | ||
| {/* Popular Categories routes */} | ||
| <Route path="latestInMarket/naturalCosmetics" element={<NaturalCosmetics />} /> | ||
|
|
||
| {/* Popular Categories */} | ||
| <Route path="popularCategories" element={<PopularCategories />} /> | ||
| <Route | ||
| path="popularCategories/beautyWellness" | ||
| element={<BeautyWellness />} | ||
| /> | ||
| <Route path="popularCategories/beautyWellness" element={<BeautyWellness />} /> | ||
| <Route path="popularCategories/bodyCare" element={<BodyCare />} /> | ||
| <Route | ||
| path="popularCategories/customizedGifts" | ||
| element={<CustomizedGifts />} | ||
| /> | ||
| <Route | ||
| path="popularCategories/fashionAccessories" | ||
| element={<FashionAccessories />} | ||
| /> | ||
| <Route | ||
| path="popularCategories/foodBeverages" | ||
| element={<FoodBeverages />} | ||
| /> | ||
| <Route | ||
| path="popularCategories/furnitureDecor" | ||
| element={<FurnitureDecor />} | ||
| /> | ||
| <Route | ||
| path="popularCategories/healthSupplements" | ||
| element={<HealthSupplements />} | ||
| /> | ||
| <Route | ||
| path="popularCategories/printingStationery" | ||
| element={<PrintingStationery />} | ||
| /> | ||
| {/* Other user routes */} | ||
| <Route path="contributors" element={<Contributors />} /> | ||
| <Route path="popularCategories/customizedGifts" element={<CustomizedGifts />} /> | ||
| <Route path="popularCategories/fashionAccessories" element={<FashionAccessories />} /> | ||
| <Route path="popularCategories/foodBeverages" element={<FoodBeverages />} /> | ||
| <Route path="popularCategories/furnitureDecor" element={<FurnitureDecor />} /> | ||
| <Route path="popularCategories/healthSupplements" element={<HealthSupplements />} /> | ||
| <Route path="popularCategories/printingStationery" element={<PrintingStationery />} /> | ||
|
|
||
| {/* Static pages */} | ||
| <Route path="about-us" element={<AboutUs />} /> | ||
| <Route path="meet-the-makers" element={<MeetTheMakers />} /> | ||
| <Route path="help" element={<Help />} /> {/* Help page route */} | ||
| <Route path="privacy-policy" element={<Privacy />} /> | ||
| {/* Privacy policy page route */} | ||
| <Route path="cart" element={<Cart />} /> | ||
| <Route | ||
| path="productDetails/:productId" | ||
| element={<ProductDetails />} | ||
| />{" "} | ||
| {/* Product details route */} | ||
| <Route path="wishlist" element={<Wishlist />} /> | ||
| {/* Wishlist page route */} | ||
| <Route path="contributors" element={<Contributors />} /> | ||
| <Route path="contact" element={<Contact />} /> | ||
| {/* Contact page route */} | ||
| <Route path="forgot-password" element={<ForgotPasswordForm />} /> | ||
| {/* Forgot password page route */} | ||
| <Route path="team" element={<Team />} /> {/* Team page route */} | ||
| <Route path="auth" element={<UserAuth />} /> | ||
| {/* User authentication page route */} | ||
| <Route path="vigy-login" element={<VigyForm />} /> | ||
| <Route path="faq" element={<FAQ />} /> {/* FAQ page route */} | ||
| <Route path="help" element={<Help />} /> | ||
| <Route path="privacy-policy" element={<Privacy />} /> | ||
| <Route path="terms-and-condition" element={<TermsAndConditions />} /> | ||
| {/* Terms and Conditions page route */} | ||
| <Route path="feedback" element={<FeedbackModal />} /> | ||
| {/* Feedback page route */} | ||
| <Route | ||
| path="return-and-cancellation" | ||
| element={<ReturnAndCancellation />} | ||
| /> | ||
| <Route path="payment-policy" element={<Payment_Policy />} /> | ||
| {/* Return and Cancellation page route */} | ||
| <Route path="epr-compliance" element={<EPR_Page />} />{" "} | ||
| {/* EPR page route */} | ||
| {/* Backward-compat: legacy URL */} | ||
| <Route | ||
| path="epr" | ||
| element={<Navigate to="/epr-compliance" replace />} | ||
| /> | ||
| <Route path="faq" element={<FAQ />} /> | ||
| <Route path="meet-the-makers" element={<MeetTheMakers />} /> | ||
| <Route path="career" element={<CareerPage />} /> | ||
| <Route path="service" element={<ServicePage />} /> | ||
| <Route path="shipping" element={<Shipping />} /> | ||
| <Route path="gift-card" element={<GiftCard />} /> | ||
| {/* EPR page route */} | ||
| {/* Private routes requiring authentication */} | ||
| <Route path="payment-policy" element={<Payment_Policy />} /> | ||
| <Route path="return-and-cancellation" element={<ReturnAndCancellation />} /> | ||
| <Route path="epr-compliance" element={<EPR_Page />} /> | ||
| <Route path="epr" element={<Navigate to="/epr-compliance" replace />} /> | ||
|
|
||
| {/* Auth & orders */} | ||
| <Route path="cart" element={<Cart />} /> | ||
| <Route path="wishlist" element={<Wishlist />} /> | ||
| <Route path="checkout" element={<Checkout />} /> | ||
| <Route path="confirm" element={<Confirmation />} /> | ||
| <Route path="cancel" element={<Cancellation />} /> | ||
| <Route path="orderDetails" element={<OrderDetails />} /> | ||
| <Route path="myorders" element={<MyOrders />} /> | ||
| <Route path="productDetails/:productId" element={<ProductDetails />} /> | ||
|
|
||
| {/* Private */} | ||
| <Route element={<PrivateRoute />}> | ||
| <Route path="/admin" element={<AdminLayout />}> | ||
| <Route index element={<AdminPanel />} /> {/* Admin panel route */} | ||
| <Route path="vigy-form" element={<VigyForm />} /> | ||
| {/* Admin Vigy form route */} | ||
| <Route path="product-form" element={<ProductForm />} /> | ||
| {/* Admin product form route */} | ||
| </Route> | ||
| <Route path="dashboard" element={<Dashboard />} /> | ||
| {/* User dashboard route */} | ||
| <Route path="confirm" element={<Confirmation />} /> | ||
| {/* Order confirmation route */} | ||
| <Route path="cancel" element={<Cancellation />} /> | ||
| {/* Order cancellation route */} | ||
| <Route path="orderDetails" element={<OrderDetails />} /> | ||
| {/* Order details route */} | ||
| <Route path="myorders" element={<MyOrders />} /> | ||
| {/* Backward-compatibility redirects */} | ||
| <Route | ||
| path="my-orders" | ||
| element={<Navigate to="/myorders" replace />} | ||
| /> | ||
| <Route | ||
| path="myOrders" | ||
| element={<Navigate to="/myorders" replace />} | ||
| /> | ||
| {/* My orders route */} | ||
| <Route path="checkout" element={<Checkout />} /> | ||
| {/* Checkout route */} | ||
| <Route path="productDetails" element={<ProductDetails />} /> | ||
| {/* Product details route */} | ||
| <Route path="payment" element={<Payment />} /> {/* Payment route */} | ||
| <Route path="dashboard-order" element={<DashboardOrders />} /> | ||
| {/* Dashboard orders route */} | ||
| <Route path="dashboard-cart" element={<DashboardCart />} /> | ||
| {/* Dashboard cart route */} | ||
| <Route path="dashboard-wishlist" element={<DashboardWishlist />} /> | ||
| {/* Dashboard wishlist route */} | ||
| <Route | ||
| path="dashboard-notifications" | ||
| element={<NotificationPage />} | ||
| /> | ||
| {/* Dashboard notifications route */} | ||
| {/* Not in use routes */} | ||
| <Route path="blog" element={<Blog />} /> | ||
| {/* additional routes */} | ||
| <Route path="giftcard" element={<GiftcardPage />} /> | ||
| <Route path="sponsorships" element={<Sponsorships />} /> | ||
| <Route path="warranty" element={<Warranty />} /> | ||
| <Route path="productCare" element={<ProductCare />} /> | ||
| <Route path="subscription" element={<Subscription />} /> | ||
| <Route path="events" element={<Events />} /> | ||
| <Route path="dashboard-notifications" element={<NotificationPage />} /> | ||
| <Route path="profile" element={<ProfilePage />} /> | ||
| {/* Dashboard Profile route */} | ||
| </Route> | ||
| {/* Certification page route */} | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why you have remove it ??? |
||
| <Route path="certification" element={<Certification />} /> | ||
| {/* Backward-compat: legacy URL */} | ||
| <Route | ||
| path="certificate" | ||
| element={<Navigate to="/certification" replace />} | ||
| /> | ||
| {/* 404 Error page route */} | ||
|
|
||
|
|
||
| <Route path="*" element={<Error />} /> | ||
| </Route> | ||
|
|
||
| {/* Admin routes */} | ||
| {/* Admin */} | ||
| <Route path="/admin" element={<AdminLayout />}> | ||
| <Route index element={<AdminPanel />} /> {/* Admin panel route */} | ||
| <Route index element={<AdminPanel />} /> | ||
| <Route path="vigy-form" element={<VigyForm />} /> | ||
| {/* Admin Vigy form route */} | ||
| <Route path="product-form" element={<ProductForm />} /> | ||
| {/* Admin product form route */} | ||
| </Route> | ||
|
|
||
| {/* Admin verification and login routes */} | ||
| <Route path="admin-verification" element={<AdminVerificationPage />} /> | ||
| <Route path="/admin/login" element={<AdminLogin />} /> | ||
| <Route path="/admin-verification" element={<AdminVerificationPage />} /> | ||
| </Routes> | ||
| </AuthProvider> | ||
| ); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
cat -n src/App.jsx | head -50Repository: codervivek5/VigyBag
Length of output: 2522
Deduplicate imports to avoid redeclaration errors.
UserAuth,Home,Privacy, andTermsAndConditionsare imported twice (lines 6–9 and again at lines 13, 18–20). This is a redeclaration syntax error. Remove the first import block (lines 6–9) since the reorganized imports below the "FIXED IMPORTS" comment are the intended set.🧹 Suggested fix
🧰 Tools
🪛 Biome (2.3.13)
[error] 13-13: Shouldn't redeclare 'UserAuth'. Consider to delete it or rename it.
'UserAuth' is defined here:
(lint/suspicious/noRedeclare)
[error] 18-18: Shouldn't redeclare 'Home'. Consider to delete it or rename it.
'Home' is defined here:
(lint/suspicious/noRedeclare)
[error] 19-19: Shouldn't redeclare 'Privacy'. Consider to delete it or rename it.
'Privacy' is defined here:
(lint/suspicious/noRedeclare)
[error] 20-20: Shouldn't redeclare 'TermsAndConditions'. Consider to delete it or rename it.
'TermsAndConditions' is defined here:
(lint/suspicious/noRedeclare)
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
look at this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codervivek5, the CodeRabbit bot correctly identified a critical issue with duplicate imports in yoursrc/App.jsxfile.The Problem:
You have four components imported twice:
UserAuth- imported at line 7 and again at line 13Home- imported at line 6 and again at line 18Privacy- imported at line 8 and again at line 19TermsAndConditions- imported at line 9 and again at line 20The Fix:
Remove lines 6-9 (the first import block):
Keep the "FIXED IMPORTS" section below, which already includes these components. This will eliminate the redeclaration errors and allow your code to compile successfully.