当遇到'TypeError: this.getOptions is not a function'错误时,通常是由于sass-loader版本过高引起的。解决办法是先卸载当前版本,然后安装版本为6.0.0的sass-loader。此外,还可能遇到'SassLoader初始化选项错误'的问题,这可能是由于额外的数据配置不匹配API导致。确保按照官方文档正确配置loader选项。
ValidationError: Invalid options object. Sass Loader has been initialized using an options object that does not match the API schema. - options has an unknown property ‘additionalData’. These properties are valid: object { implementation?, sassOptions?, prependData?, sourceMap?, webpackImporter? }