less.js icon indicating copy to clipboard operation
less.js copied to clipboard

[Compile Error] Conflict between [email protected] and [email protected]

Open Coodool opened this issue 9 years ago • 16 comments

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

Coodool avatar Oct 10 '17 15:10 Coodool

Thanks for reporting.

matthew-dean avatar Oct 10 '17 19:10 matthew-dean

ping~

afc163 avatar Oct 27 '17 02:10 afc163

Needed

jcgertig avatar Feb 14 '18 16:02 jcgertig

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

ram-mar avatar Feb 23 '18 09:02 ram-mar

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

yesmeck avatar Feb 28 '18 04:02 yesmeck

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 avatar Feb 28 '18 07:02 yesmeck

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

seven-phases-max avatar Feb 28 '18 07:02 seven-phases-max

@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?

yesmeck avatar Feb 28 '18 07:02 yesmeck

Regarding the "inline javascript" - use plugins instead.

seven-phases-max avatar Feb 28 '18 07:02 seven-phases-max

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

yesmeck avatar Feb 28 '18 07:02 yesmeck

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

seven-phases-max avatar Feb 28 '18 08:02 seven-phases-max

Thanks!

yesmeck avatar Feb 28 '18 08:02 yesmeck

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

matthew-dean avatar Mar 02 '18 18:03 matthew-dean

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.

matthew-dean avatar Jun 02 '18 17:06 matthew-dean

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.

seven-phases-max avatar Jun 05 '18 09:06 seven-phases-max

Closing this alpha bug and moving to #3182.

matthew-dean avatar Jun 25 '18 16:06 matthew-dean