next-plugin-antd-less icon indicating copy to clipboard operation
next-plugin-antd-less copied to clipboard

Warning: invalid next.config.js options detected

Open devuxer opened this issue 2 years ago • 11 comments

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);

devuxer avatar Jul 31 '22 21:07 devuxer

+1

mikerudge avatar Aug 01 '22 19:08 mikerudge

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.

madmed88 avatar Aug 03 '22 11:08 madmed88

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

peterjurco avatar Aug 09 '22 11:08 peterjurco

yep still on next 12.2.4

kasvith avatar Aug 11 '22 09:08 kasvith

The same for 12.2.5

Webbrother avatar Aug 25 '22 14:08 Webbrother

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?

MarkLyck avatar Sep 23 '22 04:09 MarkLyck

+1

0fan avatar Nov 02 '22 06:11 0fan

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

samyarkd avatar Jan 17 '23 09:01 samyarkd

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

kasvith avatar Jan 17 '23 09:01 kasvith

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

samyarkd avatar Jan 17 '23 09:01 samyarkd

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

kasvith avatar Jan 17 '23 09:01 kasvith