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

ypeError: getOptions is not a function #63

Open
ashuihui opened this issue Jun 15, 2021 · 7 comments
Open

ypeError: getOptions is not a function #63

ashuihui opened this issue Jun 15, 2021 · 7 comments

Comments

@ashuihui
Copy link

ERROR in ./node_modules/antd-dayjs-webpack-plugin/src/init-dayjs-webpack-plugin-entry.js
Module build failed (from ./node_modules/antd-dayjs-webpack-plugin/src/init-loader.js):
TypeError: getOptions is not a function

@thinkingc
Copy link

thinkingc commented Sep 29, 2021

loader-utils 0.2.17 删除了 getOptions:parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
你解决了吗

@jsm1003
Copy link

jsm1003 commented Nov 2, 2021

同问,这个问题要怎么解决呢

@dimbslmh
Copy link

dimbslmh commented Jan 6, 2022

removed getOptions in favor loaderContext.getOptions ...

Breaking Changes in loader-utils v3

It is breaking change, you need webpack v5 to use this.getOptions, getOptions was removed, if you need webpack v4 support please use v2

webpack/loader-utils#201 (comment)

@jonirrings
Copy link

maybe you should add loader-utils as dependencies? so it works with pnpm

@whale2002
Copy link

whale2002 commented Apr 23, 2022

maybe you should add loader-utils as dependencies? so it works with pnpm

It seems that Webpack V5 has method this.getOptions() to get options, and if we want to get options we don't need to use this lib? This is my view.
好家伙,原来不是歪果仁。现在webpack5好像自带了方法,可以获取options,所以我们如果只想获取options的话,这个库应该是不必要的吧

@jonirrings
Copy link

@coder-chin with pnpm, only top and direct dependencies could be referenced, thus "require(‘loader-utils’)" will fail.
pnpm下只能引用顶层依赖和直属依赖,require(‘loader-utils’)就会失败。

@BenThang
Copy link

是否有解决办法

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

7 participants