CirclonGroup / angular-tree-component

A simple yet powerful tree component for Angular (>=2)
https://angular2-tree.readme.io/docs
MIT License
1.1k stars 492 forks source link

"ERROR Error: 'tree-viewport' is not a known element" error with Angular 9.0.0-rc.3 #770

Closed PDavid closed 4 years ago

PDavid commented 5 years ago

Hi,

First of all thanks for this great library! I use your tree component in my application and it is really-really nice! 👍

The error:

When I try to use the tree component (Getting Started from docs: https://angular2-tree.readme.io/docs/) with Angular 9 rc3 version and run ng serve, the tree component is not displayed in the browser and the browser console contains the following error:

core.js:3793 ERROR Error: 'tree-viewport' is not a known element:
1. If 'tree-viewport' is an Angular component, then verify that it is part of this module.
2. If 'tree-viewport' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
    at validateElement (core.js:15953)
    at Module.ɵɵelementStart (core.js:15792)
    at TreeComponent_Template (tree.component.js:245)
    at executeTemplate (core.js:8831)
    at renderView (core.js:8671)
    at renderComponent (core.js:9773)
    at renderChildComponents (core.js:8532)
    at renderView (core.js:8696)
    at renderComponent (core.js:9773)
    at renderChildComponents (core.js:8532)

Reproduce

Unfortunately I was not able to reproduce the issue with stackblitz, but with my local Angular CLI generated projects this happens always. (I generated a new project just for this and upgraded it to Angular 9 rc3) The issue is also reproducible when I download this stackblitz project: https://stackblitz.com/edit/angular-ejnnyz

Additional Info

@NgModule({ imports: [ BrowserModule, TreeModule.forRoot() ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { }

- app.component.ts

import { Component } from '@angular/core';

@Component({ selector: 'my-app', templateUrl: './app.component.html', styleUrls: [ './app.component.css' ] }) export class AppComponent { nodes = [ {name: 'Root1', children:[ {name: 'Child1'} ]} ]; options = {} }

- app.component.html

Tree

<tree-root [nodes]="nodes" [options]="options">

- My environment:

$ ng --version

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | ' \ / | | | | |/ _ | '| | | | | | | / _ | | | | (| | || | | (| | | | || |_ | | // __| ||_, |_,||_,|| __|__|| |/

Angular CLI: 9.0.0-rc.3 Node: 12.13.0 OS: win32 x64 Angular: 9.0.0-rc.3 ... animations, cli, common, compiler, compiler-cli, core, forms ... language-service, platform-browser, platform-browser-dynamic ... router

Package Version

@angular-devkit/architect 0.900.0-rc.3 @angular-devkit/build-angular 0.900.0-rc.3 @angular-devkit/build-optimizer 0.900.0-rc.3 @angular-devkit/build-webpack 0.900.0-rc.3 @angular-devkit/core 9.0.0-rc.3 @angular-devkit/schematics 9.0.0-rc.3 @ngtools/webpack 9.0.0-rc.3 @schematics/angular 9.0.0-rc.3 @schematics/update 0.900.0-rc.3 rxjs 6.5.3 typescript 3.6.4 webpack 4.41.2



I know that Angular 9 is not stable yet (only in release candidate) but I try to migrate to it to catch any incompatibilities the project might have.

Any help is greatly appreciated!
elvisbegovic commented 5 years ago

@PDavid this should be solved here https://github.com/500tech/angular-tree-component/pull/771

As workaround you can follow https://github.com/angular/angular/issues/33685#issuecomment-557131112

PDavid commented 5 years ago

Thanks @elvisbegovic!