Docker build fails: `canvas` native compile error and Vite `yarn build` JavaScript heap OOM on `node:20-slim`
Los mantenedores suelen responder en 2 días
@Chenglong-MS ya está trabajando en esto.
Desde el 28/6/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Environment
- Command:
docker compose up --build/docker build - Base image:
node:20-slim(Dockerfilefrontend-builderstage) - Dependency:
package.jsonincludes"canvas": "^3.2.1"
Problem 1: canvas fails to compile during yarn install
Symptoms
gyp ERR! cwd /app/node_modules/canvas
gyp ERR! not ok
error Command failed with exit code 1.
Root cause
node:20-slim does not include the native build toolchain or Cairo development libraries required by the canvas npm package. Running yarn install triggers node-gyp rebuild, which fails on the slim image.
Proposed fix
Install system dependencies in the frontend-builder stage before yarn install:
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 make g++ pkg-config \
libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev librsvg2-dev \
&& rm -rf /var/lib/apt/lists/*
Problem 2: JavaScript heap OOM during yarn build
Symptoms
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
This occurs even when Docker Desktop memory is set to 12 GB or higher.
Root cause
Node.js defaults to a heap limit of roughly 2 GB, independent of the total memory allocated to Docker. Vite production builds for this project can exceed that limit.
Proposed fix
Raise the Node.js heap limit before yarn build, with an optional build-arg override:
ARG NODE_HEAP_MB=8192
ENV NODE_OPTIONS=--max-old-space-size=${NODE_HEAP_MB}
RUN yarn build
Optional in docker-compose.yml:
build:
args:
NODE_HEAP_MB: "8192"
Steps to reproduce
- Clone the repo and configure
.env - Run
docker compose up --build - Build fails at
yarn install(canvas) and/oryarn build(Vite OOM)
Expected behavior
docker compose up --build completes successfully and the service starts on port 5567.`
- Lenguaje dominante
- Python
- Estrellas
- 17.7k
- Forks
- 1.7k
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 8
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/data-formulator
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
microsoft/data-formulator#513 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/data-formulator#520 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
microsoft/data-formulator#519 ·
Los mantenedores suelen responder en 2 días
-
Data table is emptyAbierto
Dificultad 3/5 1-2 días Aptitud para principiantes 50/100
microsoft/data-formulator#518 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
microsoft/data-formulator#517 ·
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/data-formulator
Issues similares
-
[Bug]: Python SDK overwrites OVPack backups with HTTP 200 JSON errorsPosiblemente ocupada @stefanielizeth73-art la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
volcengine/OpenViking#7347 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
duolicious/duolicious#1943 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
fedora-infra/anitya#2166 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA/auto-ontology#486 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 69/100
NVIDIA/SkillEvaluator#446 ·
Los mantenedores suelen responder en 2 días