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

Class constructor FileManager cannot be invoked without 'new' #18343

Closed
1 task
Meow-z opened this issue Aug 19, 2019 · 9 comments
Closed
1 task

Class constructor FileManager cannot be invoked without 'new' #18343

Meow-z opened this issue Aug 19, 2019 · 9 comments
Assignees

Comments

@Meow-z
Copy link
Contributor

Meow-z commented Aug 19, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://github.com/ant-design/ant-design/

Steps to reproduce

编译报错
./node_modules/antd/es/tag/style/index.less

Class constructor FileManager cannot be invoked without 'new'
in undefined (line undefined, column undefined)

What is expected?

成功编译

What is actually happening?

./node_modules/antd/es/tag/style/index.less

Class constructor FileManager cannot be invoked without 'new'
in undefined (line undefined, column undefined)

Environment Info
antd 3.22.0
React 16.8.2
System macOs Mojave 10.14.5
Browser 任何
@Meow-z
Copy link
Contributor Author

Meow-z commented Aug 19, 2019

锁定之前版本 3.16.0,不会报错。

@afc163
Copy link
Member

afc163 commented Aug 19, 2019

Trace less/less.js#3414

@afc163 afc163 closed this as completed Aug 19, 2019
@montanaflynn
Copy link

What's this fix for this? All our builds stopped working, here's the error:

./node_modules/antd/es/style/index.less
Module build failed: 

Class constructor FileManager cannot be invoked without 'new'
      in undefined (line undefined, column undefined)

@afc163
Copy link
Member

afc163 commented Aug 19, 2019

It is a bug of less, not antd's, please trace less/less.js#3414 and webpack-contrib/less-loader#300 for further fix.

@montanaflynn
Copy link

@afc163 they suggest locking the less version, which would be done in antd's package.json.

@afc163
Copy link
Member

afc163 commented Aug 19, 2019

antd didn't depend less.

@montanaflynn
Copy link

@afc163 less-loader then, we fixed it by adding:

  "devDependencies": {
    "less-loader": "^5.0.0"
  }

@afc163
Copy link
Member

afc163 commented Aug 19, 2019

devDependencies won't affect your project.

@montanaflynn
Copy link

@afc163 it did, and it fixed the issue for us. Literally that's all we added and the problem went away.

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

No branches or pull requests

4 participants