SolidZORO / next-plugin-antd-less

🎩 Use Antd (Less) with Next.js v12, Zero Dependency on other Next-Plugins.
MIT License
345 stars 48 forks source link

Warning: invalid next.config.js options detected #105

Open devuxer opened 1 year ago

devuxer commented 1 year ago

When I start my Next.js app, I receive this warning:

warn  - Invalid next.config.js options detected: 
[
  {
    "instancePath": "",
    "schemaPath": "#/additionalProperties",
    "keyword": "additionalProperties",
    "params": {
      "additionalProperty": "lessVarsFilePath"
    },
    "message": "must NOT have additional properties"
  }
]
See more info here: https://nextjs.org/docs/messages/invalid-next-config

My next.config.js file looks like this:

const withAntdLess = require("next-plugin-antd-less");

const config = {
    lessVarsFilePath: "./src/front-end/styles/antd-variables.less",

    webpack(config) {
        return config;
    },

    images: {
        domains: ["images.ctfassets.net"],
    },
};

module.exports = withAntdLess(config);
mikerudge commented 1 year ago

+1

madmed88 commented 1 year ago

I started seeing similar errors when I upgraded to next 12.2.2, I went back to version 12.2.0 and the errors went away. There is a similar issue in the next.js repo https://github.com/vercel/next.js/issues/38967, it looks like it was fixed in 12.2.3 but I did not test it yet.

peterjurco commented 1 year ago

I also started to experience these messages after update of Next. It seems that even Next 12.2.4 hasn't fixed that yet.

kasvith commented 1 year ago

yep still on next 12.2.4

Webbrother commented 1 year ago

The same for 12.2.5

MarkLyck commented 1 year ago

This seems to be more of a problem with next-plugin-antd-less than next itself.

I think in 12.2.2 next added warnings for extending the config with other keys, and this is a plugin that does that but shouldn't.

Still happening in next 12.3.1 and this seems to be abandoned?

0fan commented 1 year ago

+1

samyarkd commented 1 year ago

Same issue, anyone found any solutions for this? And should i be worried about this ?

kasvith commented 1 year ago

Upgrade to latest Ant Design Version, You may not need this anymore(can configure designs with a provider)

samyarkd commented 1 year ago

Upgrade to latest Ant Design Version, You may not need this anymore(can configure designs with a provider)

By latest ants version you version 5?

Well Im afraid to mess stuff up by upgrading

kasvith commented 1 year ago

By latest ants version you version 5?

Yeah, for my usecase we had also some breaking changes. But did it anyway because it was annoying