'REACT JS and SCSS SASS error: variable undefined variable

installed required packages: node-SASS bootstrap-5 The error is: Compiled with problems: ERROR in ./src/index.scss (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[1].oneOf[7].use[3]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[7].use[4]!./src/index.scss) Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Undefined variable: "$fontFamily". on line 2 of src/styles/sass/_body.scss from line 33 of src/index.scss >> font-family: $fontFamily; ---------------^ ---------------------_body.scss----------------------------------

 body {
  font-family: $fontFamily;
  font-size: $fontSize;
  line-height: $lineHeight;
  letter-spacing: $letterSpacing;
  color: $colorText;
  background: $colorBackground;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

// close all the scroll bars
::-webkit-scrollbar {
  width: 0;
}

// Selection color
::selection {
  background: rgba($colorPrimary, 0.3);
}

// default link options
a {
  transition: none;
  color: $colorPrimary;
  outline: 0 !important;
  text-decoration: none;
  &:hover,
  &:active,
  &:focus {
    outline: 0 !important;
    color: $colorPrimary;
    text-decoration: none;
  }
}
button {
  outline: 0 !important;
  &:hover,
  &:active,
  &:focus {
    outline: 0 !important;
  }
}

// Safearea
$safeBottom: env(safe-area-inset-bottom);
$safeTop: env(safe-area-inset-top);


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source