Radix sub theme npm compilation issue

Created on 31 May 2023, about 1 year ago
Updated 15 June 2023, about 1 year ago

Problem/Motivation

Radix sub-theme npm compilation issue

Steps to reproduce

Install the latest 5.0.x version of the theme and follow the steps mentioned in the theme page

  • Download and enable the components module, if you are on Drupal 10 make sure to use
    composer require ^3.0 version:
    
    

    composer require drupal/components
    drush en components -y

  • Download and enable Radix theme:
    composer require drupal/radix; drush then radix
  • Create a sub-theme using Drush (Considering you are using drupal/recommended-project):
    drush --include="web/themes/contrib/radix" radix:create SUBTHEME_NAME
  • Set default theme:
    drush then SUBTHEME_NAME -y; drush config-set system.theme default SUBTHEME_NAME -y
  • Install dependencies:
    cd /path/to/SUBTHEME_NAME
    and then
    npm install
  • Copy the proxy.example.js to proxy.js in the config directory of your subtheme:
    cp config/proxy.example.js config/proxy.js
  • Update proxy variable to your localhost address in config/proxy.js(this file is .gitignored by default to avoid overrides)
    Watch:
    npm run watch

When running npm run watch the following error message appears which stops the SCSS to CSS compilation

module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Undefined variable.
   ╷
56 │     "secondary": $secondary-text-emphasis-dark,

Proposed resolution

This is due to $secondary-text-emphasis-dark is not in the ~bootstrap/scss/variables
This variable is in this file @import "~bootstrap/scss/_variables-dark.scss";
We need to add this in the _init.scss file after this line ~bootstrap/scss/variables

🐛 Bug report
Status

Fixed

Version

5.0

Component

Code

Created by

🇮🇳India Mukeysh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024