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'. #3414

Closed
micooz opened this issue Aug 17, 2019 · 64 comments
Closed

Class constructor FileManager cannot be invoked without 'new'. #3414

micooz opened this issue Aug 17, 2019 · 64 comments

Comments

@micooz
Copy link

micooz commented Aug 17, 2019

It seems that v3.10.0 breaks my build, webpack logs below:

ERROR in ./src/pages/score/components/current/no-join/index.less
Module build failed (from ./node_modules/_mini-css-extract-plugin@0.5.0@mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/_less-loader@4.1.0@less-loader/dist/cjs.js):


Class constructor FileManager cannot be invoked without 'new'
      in undefined (line undefined, column undefined)
    at runLoaders (/home/admin/build/node_modules/_webpack@4.39.2@webpack/lib/NormalModule.js:313:20)
    at /home/admin/build/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:367:11
    at /home/admin/build/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/admin/build/node_modules/_loader-runner@2.4.0@loader-runner/lib/LoaderRunner.js:111:13)

Everything is ok when downgrade to v3.9.0, please investigate this issue and hope to fix it as soon as possible.

@xiaoningzihai
Copy link

I have the same problem,you mast change you 'package.json' => "less": "~3.9.0", limit version

@here-we-goal
Copy link

+1

1 similar comment
@AlwaysSkylll
Copy link

+1

@lzf0402
Copy link

lzf0402 commented Aug 17, 2019

+1!
急 ~

@Liqihan
Copy link

Liqihan commented Aug 17, 2019

+1

@yolo2013
Copy link

same problem

@Doneitha
Copy link

+1 version less 3.9.0 less-loader 4.1.0

@Doneitha
Copy link

可以把package.json中 less版本的 ^ 去掉 重新安装一下 v3.9.0 应该就可以解决问题 大家可以试一下
虽然 锁定了版本 但是由于 ^, 所以会下载3 一下的最新版本, 最新版本应该是有问题的。

@lizux
Copy link

lizux commented Aug 17, 2019

+1

1 similar comment
@wangmingquan
Copy link

+1

@AlwaysSkylll
Copy link

const shortname = new this.less.FileManager().extractUrlParts(filename).filename;

这个类似代码引起的?

@Tindtily
Copy link

Tindtily commented Aug 17, 2019

omg, i limited the version to 3.9.0,works.

@starzle
Copy link

starzle commented Aug 17, 2019

Same here. npm picks up this "minor" release automatically, and breaks all of my builds. :(

@huxiaoqi567
Copy link

+1

@smackgg
Copy link

smackgg commented Aug 17, 2019

v3.10.0 same error

@AlixWang
Copy link

+1

@doxiaodong
Copy link

hurry

@simple7
Copy link

simple7 commented Aug 17, 2019

+1

@lixiaohulee
Copy link

just use less-loader@5.0.0 every thing will be ok

@0x80
Copy link

0x80 commented Aug 17, 2019

@lixiaohulee unless you're not using less-loader and everything will not be ok

@wangsanshao
Copy link

+1

afc163 added a commit to ant-design/ant-design that referenced this issue Aug 17, 2019
afc163 added a commit to ant-design/ant-design that referenced this issue Aug 17, 2019
* 🐛 Fix Cascader notFoundContent width

close #18176

* 🔒 lock less to 3.9.0

less/less.js#3416
less/less.js#3414
@asiareal
Copy link

+1

@KatDenisenko
Copy link

I have the same problem (((

@Lalitha-Iyer
Copy link

+1

@kikeztw
Copy link

kikeztw commented Aug 17, 2019

i have the same problem :/

@matthew-dean
Copy link
Member

matthew-dean commented Aug 18, 2019

This is an issue with an older version of less-loader, not Less, which did not inherit the Less filemanager correctly. less-loader 5.0 does. See: #3414 (comment)

@matthew-dean
Copy link
Member

Can someone try: #3421?

Branch is at: https://github.com/matthew-dean/less.js/tree/release/v3.10.2

The challenge in testing this is that less-loader's own tests fail on 3.9.0, so it's not clear what's expected. But, with Less's exported classes transpiled down to functions, the same errors at least get triggered in less-loader, so it's not clear if that's expected output or not. It's also not clear how or why this error occurs in Less loader v4, and doesn't occur in v5, except it may be a Webpack issue on v4?

In any case, if people can confirm that this branch as a Less dependency doesn't cause the class issue, then I'll merge it in.

@wantwant123
Copy link

+1 version less 3.9.0 less-loader 4.1.0

@MustafinVadim
Copy link

+1

1 similar comment
@huangrx-cn
Copy link

+1

@lang1427
Copy link

Manually specify less version :
npm i less@3.9.0 -D
ok!!!

@JunlinZhu-Tommy
Copy link

Fix by downgrade to 3.9.0

@vipcxj
Copy link

vipcxj commented Aug 20, 2019

Just before, I delete the node_modules and type npm i, this error happen. So the latest version 3.10.1 still has this bug. I choose downgrade to 3.9.0

@ezgitek
Copy link

ezgitek commented Aug 20, 2019

How would I fix this bug if I am using @zeit/next-less? Any help appreciated.

@hua1995116
Copy link

@ezgitek

npm i @zeit/next-less
npm i less@3.9.0

jleveugle pushed a commit to ovh/manager that referenced this issue Aug 20, 2019
With less@3.10+, our less files won't compile using less-loader.

Known issue: less/less.js#3414
@buerxixi
Copy link

https://forum.vuejs.org/t/vue-cli/72008/7
"less": "^3.10.1",
"less-loader": "^5.0.0",
is running

@matthew-dean
Copy link
Member

matthew-dean commented Aug 20, 2019

Merged: #3421

No one with less-loader v4 issues seemed willing to test [3.10.2] 🤷‍♂, but in my testing, Less-loader's v4 tests broke differently with 3.10.1 (class constructor issue), and broke the same with this PR. So..... not sure if it fixes it, but it should be no worse?

I merged that possible fix into master (but not yet released to NPM). Still would love for someone to confirm before releasing instead of the +1's.

@jenniferneale
Copy link

I can confirm I just tried the current master branch of less locally with less-loader ^4.1.0, and my project is able to build again. 👍

@jenniferneale
Copy link

Thanks for your work on this!

@matthew-dean
Copy link
Member

@jenniferneale Thanks for confirming! I'll publish to NPM later today then, can't do it from work.

@pod4g
Copy link

pod4g commented Aug 21, 2019

+1

mvollmer added a commit to mvollmer/subscription-manager that referenced this issue Aug 21, 2019
mvollmer added a commit to mvollmer/subscription-manager that referenced this issue Aug 22, 2019
@hungmanle
Copy link

Is this issue fixed with 3.10.3?

@matthew-dean
Copy link
Member

@h4ngman Should be. Re-open if not.

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