Skip to content

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

Closed

Description

@micooz

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/[email protected]@mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/[email protected]@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/[email protected]@webpack/lib/NormalModule.js:313:20)
    at /home/admin/build/node_modules/[email protected]@loader-runner/lib/LoaderRunner.js:367:11
    at /home/admin/build/node_modules/[email protected]@loader-runner/lib/LoaderRunner.js:233:18
    at context.callback (/home/admin/build/node_modules/[email protected]@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.

Activity

  1. xiaoningzihai commented on Aug 17, 2019

    @xiaoningzihai

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

  2. 10W8K commented on Aug 17, 2019

    @10W8K

    +1

  3. AlwaysSkylll commented on Aug 17, 2019

    @AlwaysSkylll

    +1

  4. lzf0402 commented on Aug 17, 2019

    @lzf0402

    +1!
    急 ~

  5. groveLqh commented on Aug 17, 2019

    @groveLqh

    +1

  6. yolo2013 commented on Aug 17, 2019

    @yolo2013

    same problem

  7. Doneitha commented on Aug 17, 2019

    @Doneitha

    +1 version less 3.9.0 less-loader 4.1.0

  8. Doneitha commented on Aug 17, 2019

    @Doneitha

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

  9. lizux commented on Aug 17, 2019

    @lizux

    +1

  10. wangmingquan commented on Aug 17, 2019

    @wangmingquan

    +1

  11. AlwaysSkylll commented on Aug 17, 2019

    @AlwaysSkylll

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

    这个类似代码引起的?

  12. Tindtily commented on Aug 17, 2019

    @Tindtily

    omg, i limited the version to 3.9.0,works.

  13. starzle commented on Aug 17, 2019

    @starzle

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

  14. huxiaoqi567 commented on Aug 17, 2019

    @huxiaoqi567

    +1

  15. smackgg commented on Aug 17, 2019

    @smackgg

    v3.10.0 same error

  16. 50 remaining items

  17. vipcxj commented on Aug 20, 2019

    @vipcxj

    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

  18. ezgitek commented on Aug 20, 2019

    @ezgitek

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

  19. hua1995116 commented on Aug 20, 2019

    @hua1995116

    @ezgitek

    npm i @zeit/next-less
    npm i [email protected]
    
  20. buerxixi commented on Aug 20, 2019

    @buerxixi
  21. matthew-dean commented on Aug 20, 2019

    @matthew-dean
    Member

    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.

  22. jenniferneale commented on Aug 20, 2019

    @jenniferneale

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

  23. jenniferneale commented on Aug 20, 2019

    @jenniferneale

    Thanks for your work on this!

  24. matthew-dean commented on Aug 20, 2019

    @matthew-dean
    Member

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

  25. pod4g commented on Aug 21, 2019

    @pod4g

    +1

  26. hungmanle commented on Aug 23, 2019

    @hungmanle

    Is this issue fixed with 3.10.3?

  27. matthew-dean commented on Aug 25, 2019

    @matthew-dean
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions