You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running ng build --configuration production inside a docker image, and the target dist directory does not exist, build fails with the following error (before compiling ES2015 to ESM2015 messages appear): angular/angular#15 31.41 An unhandled exception occurred: ENOENT: no such file or directory, stat '/usr/app/dist/project' angular/angular#15 31.41 See "/tmp/ng-WYeBTH/angular-errors.log" for further details.
Can't get to the log, since the image is thrown away.
Error does not occure when running ng build locally on my Windows machine.
Error occurs on docker hub and on my local machine's Docker desktop in multiple projects.
Error does not occure while building a library, but on every frontend (app).
Minimal Reproduction
Dockerfile
FROM node AS build
WORKDIR /usr/app
COPY ./package*.json ./
RUN npm install
COPY ./ ./
RUN npm run build --configuration production
Bug Report
Affected Package
Angular compiler(?)
Is this a regression?
Yes, it worked in 12.0.x. Doesn't work in 12.1.0.
Description
When running ng build --configuration production inside a docker image, and the target dist directory does not exist, build fails with the following error (before compiling ES2015 to ESM2015 messages appear):
angular/angular#15 31.41 An unhandled exception occurred: ENOENT: no such file or directory, stat '/usr/app/dist/project'
angular/angular#15 31.41 See "/tmp/ng-WYeBTH/angular-errors.log" for further details.
Can't get to the log, since the image is thrown away.
Minimal Reproduction
Dockerfile
FROM node AS build
WORKDIR /usr/app
COPY ./package*.json ./
RUN npm install
COPY ./ ./
RUN npm run build --configuration production
FROM nginx
WORKDIR /usr/app
COPY --from=build /usr/app/dist/project/ /usr/share/nginx/html/
COPY ./nginx/angular.conf /etc/nginx/conf.d/default.conf
Reproducing with (nearly minimal) repo:
https://github.com/rongem/spi/
Exception or Error
Your Environment
Angular Version:
Anything else relevant?
Docker version 20.10.7, build f0df350, and also Docker hub autobuild feature
Only Docker related, and libs are not affected
Workaround inside Dockerfile is pasting mkdir between copy and ng build
COPY ./ ./
RUN mkdir dist/project
RUN npm run build:all
The text was updated successfully, but these errors were encountered: