My react app build fails with the error that parsing style.scss fails.

I am using Docker to build the image. The relevant Dockerfile snippet is:
FROM node:lts-alpine3.16 as builder
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY ./package.json /app/package.json
COPY . ./
RUN npm install
RUN npm install react-scripts@3.4.1 -g
RUN npm run build
The style.scss is valid. The deployment worked a couple of months ago with the same style.scss. Anyway, this is the style.scss. I am using CoreUI react template, if that is helpful.
// If you want to override variables do it here
@import "variables";
$enable-ltr: true;
$enable-rtl: true;
// Import CoreUI styles
@import "@coreui/coreui/scss/coreui";
// Import Chart.js custom tooltips styles
@import "@coreui/chartjs/scss/coreui-chartjs";
@import "@coreui/coreui/scss/mixins/_ltr-rtl.scss";
@import "~bootstrap/dist/css/bootstrap.min.css";
@import "rc-tree/assets/index.css";
Any idea or help will be appreciated.