1

I'm using gitlab to build a Docker image from an Angular application. This always worked fine but for some reason the build breaks since yesterday during

RUN node_modules/.bin/ng build --configuration=staging

with the following error message:

    Compiling @angular/material/grid-list : es2015 as esm2015
    (node:1) UnhandledPromiseRejectionWarning: TypeError: angularCompiler.getDiagnosticsForFile is not a function
        at /opt/ng/node_modules/@ngtools/webpack/src/ivy/plugin.js:390:60
        at processTicksAndRejections (internal/process/task_queues.js:95:5)
    (Use `node --trace-warnings ...` to show where the warning was created)
    (node:1) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
    (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    ✔ Browser application bundle generation complete.
    Warning: /opt/ng/src/environments/environment.test.ts is part of the TypeScript compilation but it's unused.
    Add only entry points to the 'files' or 'include' properties in your tsconfig.
    ./src/main.ts - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js):
    Error: Cannot find module '@angular/compiler-cli/linker'

tsconfig, main.ts, package.json, Dockerfile ... haven't been changed for quite a while now so I'm clueless why this is suddenly no longer working. Any hints appreciated!

1 Answer 1

3
+50

It could be a GitLab-CI caching issue.

In your Dockerfile, see if you can add some cleanup commands:

RUN npm cache clean --force && \
rm -r node_modules && \
npm uninstall angular-cli && \
npm install --save-dev @angular/cli@latest && \

See if the issue persists then.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.