Files

33 lines
771 B
Markdown
Raw Permalink Normal View History

2023-06-04 17:39:40 +02:00
@name Root element was not found.
@category runtime
@shortDescription Root element was not found during bootstrap.
@description
2023-10-18 16:42:58 +02:00
Bootstrapped components are defined in the `bootstrap` property of an `@NgModule` decorator or as the first parameter of `bootstrapApplication` for standalone components.
2023-06-04 17:39:40 +02:00
2023-10-18 16:42:58 +02:00
This error happens when Angular tries to bootstrap one of these components but cannot find its corresponding node in the DOM.
2023-06-04 17:39:40 +02:00
@debugging
This issue occurs when the selector mismatches the tag
```typescript
@Component({
selector: 'my-app',
...
})
class AppComponent {}
```
```html
<html>
<app-root></app-root> <!-- Doesn't match the selector -->
</html>
```
Replace the tag with the correct one:
```html
<html>
<my-app></my-app> <!-- OK -->
</html>
```