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.

Inline JavaScript is not enabled

See original GitHub issue

I’m getting the following error when using your package.


// https://github.com/ant-design/ant-motion/issues/44
.bezierEasingMixin();
^
Inline JavaScript is not enabled. Is it set in your options?
      in node_modules/antd/lib/style/color/bezierEasing.less (line 110, column 0)

I have found out that javascriptEnabled is being set to true in the following snippet but the option is erroneously nested within the lessOptions object.

const lessLoaderIndex = lessModule.use.findIndex((item) => `${item.loader}`.includes('sass-loader'));
lessModule.use.splice(lessLoaderIndex, 1, {
  loader: 'less-loader',
  options: {
    lessOptions: {
      javascriptEnabled: true,
      modifyVars,
    },
  },
});

Instead the options should be set to true like this:

const lessLoaderIndex = lessModule.use.findIndex((item) => `${item.loader}`.includes('sass-loader'));
lessModule.use.splice(lessLoaderIndex, 1, {
  loader: 'less-loader',
  options: {
    javascriptEnabled: true,
    modifyVars,
  },
});

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
llamadeuscommented, Sep 25, 2020

Thanks! I found the root of the problem. Having your plugin installed along with @zeit/next-less caused two versions of less-loader being installed: 4.x and 6.x. Uninstalling @zeit/next-less solved the issue for me.

Also, thanks for this plugin! I really appreciate it.

3reactions
tech-chieftaincommented, Oct 20, 2021

Thanks! I found the root of the problem. Having your plugin installed along with @zeit/next-less caused two versions of less-loader being installed: 4.x and 6.x. Uninstalling @zeit/next-less solved the issue for me.

Also, thanks for this plugin! I really appreciate it.

@llamadeus removing @zeit/next-less solved this issue for me. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable inline javascript in LESS
Use "--js" to enable inline JavaScript (not recommended).'); break;. So you should probably use '--js' in a static compilation ( command line ) ......
Read more >
Inline JavaScript is not enabled. Is it set in your options?
However, when I'm trying to compile the project (npm run storybook) the following ERROR comes up: .bezierEasingMixin(); ^ Inline JavaScript is ...
Read more >
less loader inline javascript is not enabled. is it set in your ...
By default, the Less Loader does not enable inline JavaScript. To enable it, you will need to set the javascriptEnabled option to true...
Read more >
no-js" argument is deprecated, as inline JavaScript is ...
i tried to to run odoo 10 from eclipse in windows so i m getting this at the top of the page (lessc...
Read more >
unsafe-inline ⟶ CSP Guide
Now becuase we specified 'self' in the script-src directive we can only load JS from the same origin as our app, the request...
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