Skip to content

Angular's Ahead-of-Time Compilation: ngCompiler.ReflectorHost is not a constructor #3607

Closed
@ghost

Description

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Mac OS X El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.21
node: 7.2.1
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

There is an angular app which is levarging offline compilation with Ahead-of-Time Compilation.

This app was created using v1.0.0-beta.16 of the CLI

When running ng build --prod --aot the following error occurs:

The log given by the failure.

Normally this include a stack trace and some more information.

ngCompiler.ReflectorHost is not a constructor
TypeError: ngCompiler.ReflectorHost is not a constructor
at AotPlugin._setupOptions (/Users/DavidJohansson/Downloads/patient-portal-demo-frontend-production-build-1d9a3dcb5e586c71b7f690cce50afe2c1a4ddabd/node_modules/@ngtools/webpack/src/plugin.js:136:31)
at new AotPlugin (/Users/DavidJohansson/Downloads/patient-portal-demo-frontend-production-build-1d9a3dcb5e586c71b7f690cce50afe2c1a4ddabd/node_modules/@ngtools/webpack/src/plugin.js:37:14)
at Object.exports.getWebpackAotConfigPartial (/Users/DavidJohansson/Downloads/patient-portal-demo-frontend-production-build-1d9a3dcb5e586c71b7f690cce50afe2c1a4ddabd/node_modules/angular-cli/models/webpack-build-typescript.js:57:13)
at new NgCliWebpackConfig (/Users/DavidJohansson/Downloads/patient-portal-demo-frontend-production-build-1d9a3dcb5e586c71b7f690cce50afe2c1a4ddabd/node_modules/angular-cli/models/webpack-config.js:19:42)
at Class.run (/Users/DavidJohansson/Downloads/patient-portal-demo-frontend-production-build-1d9a3dcb5e586c71b7f690cce50afe2c1a4ddabd/node_modules/angular-cli/tasks/build-webpack.js:17:22)
at Class.run (/Users/DavidJohansson/Downloads/patient-portal-demo-frontend-production-build-1d9a3dcb5e586c71b7f690cce50afe2c1a4ddabd/node_modules/angular-cli/commands/build.js:51:26)
at Class. (/Users/DavidJohansson/Downloads/patient-portal-demo-frontend-production-build-1d9a3dcb5e586c71b7f690cce50afe2c1a4ddabd/node_modules/angular-cli/angular-cli/lib/models/command.js:152:17)
at process._tickCallback (internal/process/next_tick.js:103:7)

Mention any other details that might be useful.

I've followed the suggestions on the Github Issue Error: ngCompiler.ReflectorHost is not a constructor #3241 as well as Using Angular 2.3.0 with Latest CLI - Serve/Build Fails #3467.

I've also upgraded the @angular/* libraries to 2.3.0 and unfortunately, the issue is still persisting.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions