question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: invalid next.config.js options detected

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:6
  • Comments:7

github_iconTop GitHub Comments

2reactions
MarkLyckcommented, Sep 23, 2022

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?

0reactions
0fancommented, Nov 2, 2022

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatible with next.js 12.2.0: "Invalid next.config.js ... - GitHub
When compiling with next.js 12.2.0, this warning is shown, even when an empty array is passed for the plugins parameter: warn - Invalid...
Read more >
warning Invalid next.config.js when running project - nextJs
When I want to run my project i have these three warnings: 1- warn - Invalid next.config.js options detected: The root value has...
Read more >
invalid-images-config - Next.js
Invalid images config. Why This Error Occurred. In your next.config.js file you provided an invalid config for the images field.
Read more >
the request of a dependency is an expression nextjs - You.com
1- warn - Invalid next.config.js options detected: The root value has an unexpected property, webpack5, which is not in the list of allowed...
Read more >
Plugins – Configuration – Intro to Next.js
The next.config.js file gives us the ability to do some powerful stuff. Because the config file has a convention, you should be able...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found