Skip to content

[Help Wanted] Node-sass issue in docker #145

@heteibako

Description

@heteibako

Version

1.9.0

Reproduction link

http://localhost:3000

Operating System

Mac Osx BigSur

Device

MacBook Pro 15 retina

Browser & Version

Chrome latest

Steps to reproduce

Running the the app in a dockerized container
then I get this error:
Failed to compile.
./src/assets/scss/material-dashboard-pro-react.scss (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-6-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--5-oneOf-6-3!./node_modules/sass-loader/dist/cjs.js??ref--5-oneOf-6-4!./src/assets/scss/material-dashboard-pro-react.scss)
To import Sass files, you first need to install node-sass.
Run npm install node-sass or yarn add node-sass inside your workspace.

What is expected?

The React app runs in the docker environment

What is actually happening?

The compile process results to fail


Solution

My Dockerile looks like this

FROM node:10

Create app directory

WORKDIR /app
COPY package*.json ./

COPY . .
RUN npm install
RUN npm rebuild node-sass
RUN npm run build
EXPOSE 3000
CMD ["npm", "start" ]

Additional comments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions