Generic error: Runtime compiler is not loaded,

pankaj

I am creating a directive in VSCode Editor which loads a html page on specifying a given path:

Below is the code for same:

@Directive({
 selector: 'html-outlet'
})

export class HtmlOutlet {
 @Input() html: string;

 constructor(private vcRef: ViewContainerRef, private compiler: Compiler) { 
}

ngOnChanges() {
const html = this.html;
if (!html) return;

@Component({
    selector: 'dynamic-comp',
    templateUrl: html
})
class DynamicHtmlComponent { };

@NgModule({
    imports: [CommonModule],
    declarations: [DynamicHtmlComponent]
})
class DynamicHtmlModule { }

this.compiler.compileModuleAndAllComponentsAsync(DynamicHtmlModule)
    .then(factory => {
        const compFactory = factory.componentFactories.find(x => x.componentType === DynamicHtmlComponent);
        const cmpRef = this.vcRef.createComponent(compFactory, 0);
    });}}

This code used to work perfectly fine untill i upgraded app to angular 6. I am getting below error now :

Runtime compiler is not loaded Error stack trace: Error: Runtime compiler is not loaded at Le (main.00612d315fe86075b5fb.js:1) at t.compileModuleAndAllComponentsAsync

Can i get some help in this

rusev

If you are running the application in --prod mode it will default to AOT, which doesn't provide the compiler.

I don't think that the Angular team is encouraging the pattern of using the compiler at runtime at all.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Angular AoT and Rollup - Error: Runtime compiler is not loaded

From Dev

EXCEPTION: Runtime compiler is not loaded

From Dev

Angular 5 Runtime compiler is not loaded

From

Runtime compiler is not loaded with Angular 8 and lazy module

From Dev

java generic method, runtime error,

From Dev

Dividing by 0 is a compiler error or a runtime error

From Dev

ionic runtime error - zone already loaded

From Dev

"Runtime Error Zone already loaded" in ionic 3

From Java

Java - When is it a compiler error and when is it a runtime exception?

From Dev

Compiler error with calling Generic methods java

From Java

compiler giving generic error in Collectors toMap

From Java

Compiler error on Java generic interface with a List<> method

From Dev

compiler error c1001 in generic class

From Dev

C macro _Generic gives unexpected compiler error

From Dev

Invalid redeclaration compiler error on generic type extension

From Dev

Resolve compiler error in type constraint of generic type

From Dev

Error "unresolved external symbol" when library is dynamically loaded at runtime

From Dev

Runtime error: dyld: Library not loaded: @rpath/AWSCore.framework/AWSCore

From Dev

Runtime error creating map c++ visual studio compiler

From Dev

Unexpected compiler error when attempting to use generic type in closure

From Java

Why does this nested generic cast cause a compiler error

From Java

Generic permutation function element comparison gives compiler error

From Dev

Conditional type add a extra generic got compiler error

From Dev

Weird compiler error in generic class using the Linq ExceptBy function

From Dev

c# compiler error when passing `this` to a delegate that accepts generic parameter

From Dev

Compiler errors when using method reference as lambda to methods that expect interface with generic type, when runtime type is also generic type

From Dev

Delete MC loaded in runtime

From Java

Java compiler at Runtime

From Dev

Flatbuffer: Compatibility of runtime and compiler

Related Related

  1. 1

    Angular AoT and Rollup - Error: Runtime compiler is not loaded

  2. 2

    EXCEPTION: Runtime compiler is not loaded

  3. 3

    Angular 5 Runtime compiler is not loaded

  4. 4

    Runtime compiler is not loaded with Angular 8 and lazy module

  5. 5

    java generic method, runtime error,

  6. 6

    Dividing by 0 is a compiler error or a runtime error

  7. 7

    ionic runtime error - zone already loaded

  8. 8

    "Runtime Error Zone already loaded" in ionic 3

  9. 9

    Java - When is it a compiler error and when is it a runtime exception?

  10. 10

    Compiler error with calling Generic methods java

  11. 11

    compiler giving generic error in Collectors toMap

  12. 12

    Compiler error on Java generic interface with a List<> method

  13. 13

    compiler error c1001 in generic class

  14. 14

    C macro _Generic gives unexpected compiler error

  15. 15

    Invalid redeclaration compiler error on generic type extension

  16. 16

    Resolve compiler error in type constraint of generic type

  17. 17

    Error "unresolved external symbol" when library is dynamically loaded at runtime

  18. 18

    Runtime error: dyld: Library not loaded: @rpath/AWSCore.framework/AWSCore

  19. 19

    Runtime error creating map c++ visual studio compiler

  20. 20

    Unexpected compiler error when attempting to use generic type in closure

  21. 21

    Why does this nested generic cast cause a compiler error

  22. 22

    Generic permutation function element comparison gives compiler error

  23. 23

    Conditional type add a extra generic got compiler error

  24. 24

    Weird compiler error in generic class using the Linq ExceptBy function

  25. 25

    c# compiler error when passing `this` to a delegate that accepts generic parameter

  26. 26

    Compiler errors when using method reference as lambda to methods that expect interface with generic type, when runtime type is also generic type

  27. 27

    Delete MC loaded in runtime

  28. 28

    Java compiler at Runtime

  29. 29

    Flatbuffer: Compatibility of runtime and compiler

HotTag

Archive