DEV Community

Cover image for TypeError: fs.existsSync is not a function
Aishanii
Aishanii

Posted on

TypeError: fs.existsSync is not a function

While using Sass in a react project and using useRef hook, one might come across this error:

React and Sass error

To solve this, simply look for

import {yourvarname} from "node-sass";

in the component where ref is being used and remove this line. Visual Studio Code automatically adds the line which causes the given error.

More on this: https://vscode-docs.readthedocs.io/en/latest/languages/css/

Discussion (0)