Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compile Error] Conflict between less@3.0.0-alpha.3 and antd@2.13.4 #3113

Closed
Coodool opened this issue Oct 10, 2017 · 16 comments
Closed

[Compile Error] Conflict between less@3.0.0-alpha.3 and antd@2.13.4 #3113

Coodool opened this issue Oct 10, 2017 · 16 comments

Comments

@Coodool
Copy link

Coodool commented Oct 10, 2017

Version

less@3.0.0-alpha.3
antd@2.13.4

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 less@2.7.1.

Click here for more discussion in ant-design

@matthew-dean
Copy link
Member

Thanks for reporting.

@afc163
Copy link

afc163 commented Oct 27, 2017

ping~

@jcgertig
Copy link

Needed

@ram-mar
Copy link

ram-mar commented Feb 23, 2018

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

@yesmeck
Copy link

yesmeck commented Feb 28, 2018

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

@yesmeck
Copy link

yesmeck commented Feb 28, 2018

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.

@seven-phases-max
Copy link
Member

seven-phases-max commented Feb 28, 2018

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

@yesmeck
Copy link

yesmeck commented Feb 28, 2018

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

@seven-phases-max
Copy link
Member

Regarding the "inline javascript" - use plugins instead.

@yesmeck
Copy link

yesmeck commented Feb 28, 2018

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

@seven-phases-max
Copy link
Member

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

@yesmeck
Copy link

yesmeck commented Feb 28, 2018

Thanks!

@matthew-dean
Copy link
Member

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
Copy link
Member

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.

@seven-phases-max
Copy link
Member

seven-phases-max commented Jun 5, 2018

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.

@matthew-dean
Copy link
Member

Closing this alpha bug and moving to #3182.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants