DEV Community

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

Posted on

3 1

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/

Top comments (0)

nextjs tutorial video

Youtube Tutorial Series ๐Ÿ“บ

So you built a Next.js app, but you need a clear view of the entire operation flow to be able to identify performance bottlenecks before you launch. But how do you get started? Get the essentials on tracing for Next.js from @nikolovlazar in this video series ๐Ÿ‘€

Watch the Youtube series

๐Ÿ‘‹ Kindness is contagious

Please leave a โค๏ธ or a friendly comment on this post if you found it helpful!

Okay