Skip to content

Could/would/will code using COMPILER_PROVIDERS be supported by AOT? #11780

Closed
@Radim-Kohler

Description

@Radim-Kohler

When I run a command

>"node_modules/.bin/ngc" -p ./

I get the error:

Error: Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function (position 65:17 in the original .ts file), resolving symbol COMPILER_PROVIDERS in .../node_modules/@angular/compiler/src/compiler.d.ts,

That all is related to this piece of code

@NgModule({
    ...
    providers: [
        COMPILER_PROVIDERS
    ],  
})
export class AppModule {}

Once COMPILER_PROVIDERS are not declared

    providers: [
        // COMPILER_PROVIDERS

then AOT works as expected... just ... as also expected, the app is not working (simply, COMPILER_PROVIDERS are needed for it)

I did see this "encouraging disclaimer"

/**
 * @module
 * @description
 * Entry point for all APIs of the compiler package.
 *
 * <div class="callout is-critical">
 *   <header>Unstable APIs</header>
 *   <p>
 *     All compiler apis are currently considered experimental and private!
 *   </p>
 *   <p>
 *     We expect the APIs in this package to keep on changing. Do not rely on them.
 *   </p>
 * </div>

So - it is experimental, private, "I cannot rely on it" ... but I need it.

Please, am I doing something wrong? or is intended ... COMPILER_PROVIDERS will never be supported by AOT?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions