elado / next-with-less

Next.js + Less CSS Support
MIT License
143 stars 24 forks source link

Global CSS cannot be imported from files other than your Custom <App> #23

Closed Waylon-Firework closed 2 years ago

Waylon-Firework commented 2 years ago

./src/components/example-component-a/index.less 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: src/components/example-component-a/index.tsx

Waylon-Firework commented 2 years ago
  "dependencies": {
    "next": "12.1.0",
    "next-compose-plugins": "^2.2.1",
    "next-with-less": "^2.0.5",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
Waylon-Firework commented 2 years ago
image

if i add a ".module." to the less file name, will show this error. index.less => index.module.less

Waylon-Firework commented 2 years ago

peer dependency