ERROR: Issue detected in the e class under the e_Host - inline template 0:0

As I was upgrading my angular2 project to RC5, a major issue surfaced. Despite reducing all the code to its minimum in order to debug the problem, I couldn't pinpoint its origin. Every request made by my app led to the following error message (as seen in the Developer console in the browser):

EXCEPTION: Error in ./e class e_Host - inline template 0:0
ORIGINAL EXCEPTION: The selector "ng-component" did not match any elements

Here is the simplified version of my code, which I believe is as basic as it gets:

main.ts

///<reference path="../node_modules/typescript/lib/lib.es6.d.ts"/>
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AdminModule }              from './component/admin/admin.module';

platformBrowserDynamic().bootstrapModule(AdminModule);

admin.module.ts

import {NgModule}         from '@angular/core';
import {BrowserModule}                from '@angular/platform-browser';

import {TestComponent} from '../admin/test/test';

@NgModule({
    declarations: [TestComponent],
    providers: [],
    imports: [BrowserModule],
    bootstrap: [TestComponent],
})
export class AdminModule {
}

test.ts

import {Component} from '@angular/core';
@Component({
    //templateUrl  : 'public/component/admin/test/test.html',
    template: '<h1>Hello World!</h1>',
    directives: []
})
export class TestComponent {}

I have double and triple checked every path and include for validity and everything appears to be fine so far.

This is how my npm setup looks like:

package.json

{
  "name": "Angular2Boilerplate",
  "version": "0.1.0",
  "description": "Angular2Boilerplate",
  "main": "index.js",
  "scripts": {
    "test": "gulp test"
  },
  "dependencies": {
    "@angular/common": "2.0.0-rc.5",
    "@angular/compiler": "2.0.0-rc.5",
    "@angular/core": "2.0.0-rc.5",
    "@angular/forms": "0.3.0",
    "@angular/http": "2.0.0-rc.5",
    "@angular/platform-browser": "2.0.0-rc.5",
    "@angular/platform-browser-dynamic": "2.0.0-rc.5",
    "@angular/router": "3.0.0-rc.1",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.5",
    "angular2-localstorage": "^0.3.0",

    "systemjs": "0.19.27",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.6",
    "zone.js": "^0.6.12",
    "primeng": "^1.0.0-beta.8",
    "primeui": "^4.1.12"
  },
  "devDependencies": {
    "browser-sync": "^2.10.0",
    "del": "^2.2.0",
    "gulp": "^3.8.11",
    "gulp-clean": "^0.3.2",
    "gulp-concat": "^2.6.0",
    "gulp-debug": "^2.0.1",
    "gulp-inject": "^1.2.0",
    "gulp-rimraf": "^0.1.1",
    "gulp-sass": "^2.1.1",
    "gulp-sass-glob-import": "^0.1.0",
    "gulp-sourcemaps": "^1.5.1",
    "gulp-tslint": "^1.4.4",
    "gulp-typescript": "^2.5.0",
    "gulp-uglify": "^1.5.1",
    "superstatic": "^3.0.0",
    "typescript": "^1.8.10"
  },
  "keywords": [
    "angular2",
    "typescript",
    "sass",
    "gulp"
  ],
  "author": "André Kirchner",
  "license": "MIT"
}

I've tried everything possible to track down the issue, but now I'm reaching out for your assistance. Does anyone have an idea of what might be going wrong?

Answer №1

Your TestComponent is missing the required selector field. Ensure you include this component in your index.html, as it is the one being bootstrapped. I encountered a similar issue when testing in my own project - removing

<my-app>Loading...</my-app>
from index.html resulted in the same error:

https://i.sstatic.net/bsEmK.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Managing Access Control Origin Headers in an Angular 4 Application

I currently have a Play framework based REST API running locally on port 9000 of my machine. Additionally, I have an Angular 4 application running on port 4200 on the same localhost. My goal is to have this Angular app display the JSON data received from ...

Designing a sequential bar graph to visualize intricate data using AmCharts

I received the following response from the server in JSON format: [{ "data1": { "name": "Test1", "count": 0, "amount": 0, "amtData": [ 0,0,0,0 ], "cntData": [ 0,0,0,0 ], "color": "#FF0F00" }, "data2": { ...

Installing packages with npm seems to take an eternity, all because it claims that I am working

I'm attempting to install various packages using npm 8.19.2, such as yarn. sudo npm install --global yarn However, all I'm receiving is: npm ERR! code ETIMEDOUT npm ERR! syscall connect npm ERR! errno ETIMEDOUT npm ERR! network request to https ...

If the span id includes PHP data that contains a certain phrase

Hey there, it's my first time posting and I'm in a bit of a bind with this script... Let me give you some background information first I am trying to create a click function for a register button that will check the span id (e.g. $("#username_r ...

Leveraging the power of literal types to choose a different type of argument

My API is quite generic and I'm looking for a typed TypeScript client solution. Currently, my code looks like this: export type EntityTypes = | 'account' | 'organization' | 'group' export function getListByVa ...

Exploring the Possibilities of WebAudio API through Asynchronous Events

Is there a way to trigger events after an oscillator finishes playing using the webaudio API? I am attempting to update my Vue component reactively to display data in the DOM while a note is being played. Here's a snippet of my code: <template> ...

Encountering difficulties while trying to install yarn using npm

I'm attempting to install yarn using npm on my Mac following the instructions provided in this documentation npm install --global yarn However, when I enter this command in the terminal, I encounter an error and the package fails to install npm WARN ...

Navigating with Express while incorporating React

I am struggling to set up the routes for my web application using Express, as well as incorporating React for the front end. The issue lies in properly routing things when React components are involved. My index.html contains: <script> document.get ...

Challenge encountered when utilizing angular 2 RC router for programmatic route navigation

Currently, I am utilizing the RC router in version rc1 with two defined routes as shown below: @Routes([ {path: '/', component: HomeComponent}, {path: '/signin', component: SigninComponent}, {path: '/dashboard', c ...

Exploring Angular Unit Testing: A Beginner's Guide to Running a Simple Test

I'm diving into the world of angular unit testing and looking to set up my first successful test. Here's what I've come up with: import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AppComponent } fro ...

Node.js express version 4.13.3 is experiencing an issue where the serveStatic method is not properly serving mp3 or

I am currently utilizing Express 4.13.3 along with the serve-static npm module to serve static assets successfully, except for files with mp3 or ogg extensions. Despite reviewing the documentation, I have not come across any information indicating that thi ...

What is the best way to utilize typed variables as types with identical names in Typescript?

Utilizing THREE.js with Typescript allows you to use identical names for types and code. For instance: import * as THREE from '/build/three.module.js' // The following line employs THREE.Scene as type and code const scene: THREE.Scene = new THRE ...

The information retrieved from the API is not appearing as expected within the Angular 9 ABP framework

I am facing an issue with populating data in my select control, which is located in the header child component. The data comes from an API, but for some reason, it is not displaying correctly. https://i.stack.imgur.com/6JMzn.png. ngOnInit() { thi ...

Pass the previousItem to the click event handler within the *ngFor loop

Could I possibly retrieve the previous value of an item in an *ngFor loop when a specific event like click() is triggered? For instance: <myItem *ngFor="let data of dataList"> <div (click)="onClick(data, prevData)"> </myItem ...

Endless cycle plaguing Grunt tasks

Currently in the process of setting up a foundation Gruntfile.js for some upcoming projects. Recently started working on a new computer, so I had to rebuild everything from scratch. Used Homebrew to install Node and NPM, followed by installing Grunt global ...

Experiencing difficulty when attempting to save a zip file to the C drive

I came across this code snippet on SO and decided to use it for my project. The goal is to send a simple 1.5mb zip file and save it on my C drive by making a request through Postman with the binary option enabled, sending the zip file to localhost:3012. c ...

Encountering issues when using array.map with null entries in a react application

Struggling to iterate over the location array and map it? Despite several attempts, handling the null object within the array seems challenging. What am I missing here? While using a for loop resolves the issue, the map function is proving to be a roadbloc ...

Identify when a request is being executed using AJAX by checking the URL

My current code includes multiple ajax requests from various JavaScript files. I am looking for a way to identify specific ajax requests and interrupt their execution in order to prioritize a newer one. Is it possible to detect and stop ajax requests based ...

Employing the `instanceof` operator on instances generated by constructors from complex npm dependencies

Context: In one of my npm modules, I've implemented error handling code with a custom error type called CustomError: function CustomError () { /* ... */ } CustomError.prototype = Object.create(Error.prototype); CustomError.prototype.constructor = Cu ...

Is it possible to implement sandboxing for Node.js modules?

I've been diving into the world of Node.js and I have this exciting idea to create a cutting-edge MUD (online text-based game) using it. Traditionally, MUD games have predefined commands, skills, and spells that players can use to navigate through var ...