./pages/shop/src/styles/BestSellers.css Global CSS cannot be imported from files other…
- User
./pages/shop/src/styles/BestSellers.css Global CSS cannot be imported from files other than your Custom . Due to the Global nature of stylesheets, and to avoid conflicts, Please move all first-party global CSS imports to pages/_app.js. Or convert the import to Component-Level CSS (CSS Modules). Read more: https://nextjs.org/docs/messages/css-global Location: pages\shop\src\components\CartHold.js
- Assistant
Based on the error you're encountering, it seems you're trying to import a global CSS file (
BestSellers.css) from a component file () in a Next.js project. Next.js enforces certain rules for styling to ensure consistent loading and avoid conflicts, one of which is how global CSS is imported into your project. - User
The root cause is, i have added a complete ecommerce react app to my pages folder in the current react app which is my web portfolio. The goal is, when a user clicks on a nav that has the path as /shop as its page prop route navigation, the ecommerce app will be displayed to the user. The issue is the ecommerce app has its on styles folder which is meant to style its components and that is what is causing the "./pages/shop/src/styles/BestSellers.css Global CSS cannot be imported from files other than your Custom . Due to the Global nature of stylesheets, and to avoid conflicts, Please move all first-party global CSS imports to pages/_app.js. Or convert the import to Component-Level CSS (CSS Modules). Read more: https://nextjs.org/docs/messages/css-global Location: pages\shop\src\components\CartHold.js" error
- Assistant
- User
i do not want to edit the files as they are many js and css files required in the ecommerce app. Show me a solution that allows me to import the styles globally without causing initial paint delay
- Assistant
- User
Uncaught runtime errors: ERROR can't access property "style", document.querySelector(...) is null dontShowHandler@http://localhost:3000/static/js/bundle.js:514:14 callCallback@http://localhost:3000/static/js/bundle.js:36575:18 invokeGuardedCallbackDev@http://localhost:3000/static/js/bundle.js:36619:20 invokeGuardedCallback@http://localhost:3000/static/js/bundle.js:36676:35 invokeGuardedCallbackAndCatchFirstError@http://localhost:3000/static/js/bundle.js:36690:29 executeDispatch@http://localhost:3000/static/js/bundle.js:40833:46 processDispatchQueueItemsInOrder@ processDispatchQueue@ dispatchEventsForPlugins@ ./node_modules/react-dom/cjs/react-dom.development.js/dispatchEventForPluginEventSystem/<@ batchedUpdates$1@ batchedUpdates@ dispatchEventForPluginEventSystem@ dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay@ dispatchEvent@ dispatchContinuousEvent@
- Assistant
- User
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.