Less.js: [Compile Error] Conflict between [email protected] and [email protected]

Created on 10 Oct 2017  ·  16Comments  ·  Source: less/less.js

Version

[email protected]
[email protected]

Steps to reproduce

Compile the antd.less directly in the CLI:

lessc ./node_modules/antd/dist/antd.less

Error log

FileError: './themes/default' wasn't found. Tried - D:\Projects\ncslab\node_modules\antd\lib\style\themes\default,D:\Projects\ncslab\node_modules\antd\dist\themes\default,D:\Projects\ncslab\node_modules\themes\default,themes\default.less in D:\Projects\ncslab\node_modules\antd\lib\style\index.less on line 1, column 1:
1 @import "./themes/default";
2 @import "./core/index";

Additional comment

It goes well with [email protected].

Click here for more discussion in ant-design

consider closing needs decision needs info

Most helpful comment

ping~

All 16 comments

Thanks for reporting.

ping~

Needed

Faced the same issue, occurs in all 3.0.* versions - both in alpha and stable versions.

It seems less 3 does not support the function hack anymore, @matthew-dean could you confirm it?

The FileError: './themes/default' wasn't found error seems was fixed already. I encounter another error which was reported in #3182.

The reason is the bezierEasingMixin function doesn't have a return value, and the parser will try to parse the undefined value which leads the error.

@yesmeck For your first question the answer is: "inine javascript is disabled by default" (see changelog).

@seven-phases-max Thanks for the response, I'm looking into this issue, and got an error when compile custom function, so I ask the question here.

I found the reason as I commented above, but I don't understand less codebase very well, so I can't figure out how to fix it. Could you take a look?

Regarding the "inline javascript" - use plugins instead.

Looks good, we don't need the hack anymore, thanks!

Just FYI, this plugin functionality ("custom functions via @plugin") was available since around 2015.

Thanks!

It seems less 3 does not support the function hack anymore, @matthew-dean could you confirm it?

Inline JS was never designed for that purpose, and yes, it's now disabled by default for security reasons. Even without @plugin syntax, Less plugins have been around for a long time and have been the intended tool for adding functions. But with @plugin, it's even more powerful, because you can isolate your declared functions to Less scope. (Visitors added by @plugin are still global.)

This mainly seems to be an Inline JavaScript / less configuration issue and not a bug.

If the only issue is:

The reason is the bezierEasingMixin function doesn't have a return value, and the parser will try to parse the undefined value which leads the error.

That may be valid. Leaving open but downgrading this issue.

I'm about to close this ticket (in favour of reopened #3182) - because the original issue is solved somehow (how?) and for another issue ("antd is abusing some never specified inline js behaviour which is no longer there") it should be a new one. Please, let's not have these "all-in-one" tickets that are impossible to track.

Closing this alpha bug and moving to #3182.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jonschlinkert picture jonschlinkert  ·  112Comments

rjgotten picture rjgotten  ·  118Comments

matthew-dean picture matthew-dean  ·  59Comments

lukeapage picture lukeapage  ·  102Comments

Soviut picture Soviut  ·  64Comments