After installing scss, it reported an error Module build failed: TypeError: loaderContext.getResolve is not a function

After scss is installed , the following error is reported:

Module build failed: TypeError: loaderContext.getResolve is not a function
    at getWebpackImporter (K:\vue-project\vue-demo\node_modules\sass-loader\dist\utils.js:274:37)
    at Object.loader (K:\vue-project\vue-demo\node_modules\sass-loader\dist\index.js:42:61)

I am here because the installed sass-loader version is too high. . . . .

Solution:

1. Check the sass-loader version: check in package.json

2. Uninstall the current sass-loader

npm uninstall sass-loader

3. Install the lower version of sass-loader, the version I installed here is 7.3.1

npm install [email protected]

Can start normally

Guess you like

Origin blog.csdn.net/huangge1199/article/details/107537336