Could/would/will code using COMPILER_PROVIDERS be supported by AOT?
See original GitHub issueWhen 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?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:44
- Comments:35 (16 by maintainers)
Don’t use runtime compiler and aot.
Unless you’re developing a library which creates components dynamically - as we are.
Our users want to be able to use AoT compiling on their projects, but we’re unable to compile ours first (and generate the necessary metadata files) due to the above issue