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.

ValidationError on `lessLoaderOptions.javascriptEnabled`

See original GitHub issue

2 days ago craco-less upgraded less-loader from 5 to 6 that has a braking change.

This causes the following error:

ValidationError: Invalid options object. Less Loader has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'javascriptEnabled'. These properties are valid:
   object { lessOptions?, prependData?, appendData?, sourceMap?, implementation? }

There are 2 fixes that can be done:

  1. Pin the version of craco-less to 1.16.0
  2. Use the new lessOptions as described here

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
daniel-hausercommented, May 31, 2020

@ndbroadbent the issue wasn’t fixed, can you please re-open it?

As I mentioned earlier, there are only 2 options:

  1. pin craco-less to 1.16.0 (uses less-loader@5) - a hotfix, done in #34
  2. change the code here to work with less-loader@6 (see changes here) - the real fix, but can brake code for current users
3reactions
adijesoricommented, May 31, 2020

@ndbroadbent I’m having the same error mentioned by @daniel-hauser also in the new version 1.15.0

ValidationError: Invalid options object. Less Loader has been initialized using an options object that does not match the API schema.
 - options has an unknown property 'javascriptEnabled'. These properties are valid:
   object { lessOptions?, prependData?, appendData?, sourceMap?, implementation? }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack less-loader javascriptEnabled Error - Stack Overflow
I was getting this error when I moved from less-loader version 6.0.0 to version 6.1.0 when trying to load my Ant Design library...
Read more >
validationerror: invalid options object. less loader has been ...
Notice that the javascriptEnabled flag is not under the top-level options object, but it, ... DocSpring/craco-antdValidationError on `lessLoaderOptions.
Read more >
rsuite/rsuite - Gitter
node_modules/less-loader/dist/cjs.js): ValidationError: Invalid options object. ... { loader: 'less-loader', options: { lessOptions: { javascriptEnabled: ...
Read more >
less-loader options has an unknown property 'javascriptenabled'
less-loader options has an unknown property 'javascriptenabled'技术、学习、经验文章掘金 ... node_modules/sass-loader/dist/cjs.js): ValidationError: Invalid.
Read more >
antd 踩坑之javascriptEnabled配置 - CSDN博客
vue.config.js 配置javascriptEnabled 后依然报错css: { loaderOptions: { less: { javascriptEnabled: true } } } ValidationError: Invalid options ...
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