Error Encountered in Kendo UI Angular: (SystemJS) HTML Syntax Error Detected

I am currently working on a project using VS2015 RC3, Angular2 2.0.0 within an ASP.NET Core solution hosted on IIS.

When attempting to incorporate new UI modules like dropdowns or inputs, I keep encountering a SystemJS error. However, strangely enough, my buttons work perfectly without any issues...

master.module.ts :

import { ButtonsModule } from '@progress/kendo-angular-buttons';
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
import { InputsModule } from '@progress/kendo-angular-inputs';

@NgModule({
    imports: [
        CommonModule,
        MasterRouting,
        ButtonsModule,  // => Works fine and button is showing as expected 
        InputsModule,   // Error : Unexpected Token
        DropDownsModule // Error : Unexpected Token
    ],
    [...]

The errors I encounter are dependent on which module I attempt to add in the "imports" array:

InputsModule error: pointing at the import line in my master.modules.ts

zone.js:192 Error: (SystemJS) Unexpected token < SyntaxError: Unexpected token < at Object.eval (http://localhost:39351/app/master/master.module.js:35:30)

DropdownsModule error:

zone.js:192 Error: (SystemJS) Unexpected token < SyntaxError: Unexpected token < at Object.eval (http://localhost:39351/node_modules/@progress/kendo-angular-dropdowns/dist/npm/js/combobox.component.js:630:19)

This particular error highlights the import in the kendo library:

module.exports = require("@telerik/kendo-dropdowns-common/dist/npm/js/bundle");

which I have verified exists in my wwwroot...

EDIT: From the error logs, it seems that there is an issue with evaluating the @telerik bundle with an incorrect path. But then, why hasn't SystemJS configuration been set up for the telerik packages in the documentation? Am I missing something here?

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

I am feeling completely baffled by this issue, so any assistance would be greatly appreciated...


Here are some additional files that may provide further insight:

tsconfig.json:

{
  "compilerOptions": {
    "outDir": "./wwwroot/app/",
    "target": "es5",
    "module": "commonjs",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "inlineSourceMap": true,
    "inlineSources": true
  },
  "exclude": [
    "./node_modules/**",
    "./wwwroot/**",
    "./typings/**"
  ]
}

systemjs.config.js:

(function (global) {
    // map tells the System loader where to look for things
    var map = {
        // Our components
        'app': 'app', // 'dist',

        // Angular2 + rxjs
        '@angular': 'node_modules/@angular',
        'rxjs': 'node_modules/rxjs',
        'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
        // Kendo Angular2
        '@progress/kendo-angular-buttons': 'node_modules/@progress/kendo-angular-buttons',
        '@progress/kendo-angular-dropdowns': 'node_modules/@progress/kendo-angular-dropdowns',
        '@progress/kendo-angular-inputs': 'node_modules/@progress/kendo-angular-inputs',
    };

    // packages tells the System loader how to load when no filename and/or no extension
    var packages = {
        // Our components
        'app': { defaultExtension: 'js'},

        // Angular2 + rxjs 
        'rxjs': { defaultExtension: 'js' },
        'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },

        '@progress/kendo-angular-buttons': {
            main: './dist/npm/js/main.js',
            defaultExtension: 'js'
        },
        '@progress/kendo-angular-dropdowns': {
            main: './dist/npm/js/main.js',
            defaultExtension: 'js'
        },
        '@progress/kendo-angular-inputs': {
            main: './dist/npm/js/main.js',
            defaultExtension: 'js'
        },
    };

    /**** node_modules basic config! Do not touch ****/
    // name of packages to assimilate (angular 2 only here)
    var ngPackageNames = [
      'common',
      'compiler',
      'core',
      'forms',
      'http',
      'platform-browser',
      'platform-browser-dynamic',
      'router',
      'router-deprecated',
      'upgrade',
    ];

    // Individual files (~300 requests):
    function packIndex(pkgName) {
        packages['@angular/' + pkgName] = { main: 'index.js', defaultExtension: 'js' };
    }

    // Bundled (~40 requests):
    function packUmd(pkgName) {
        packages['@angular/' + pkgName] = { main: 'bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
    }

    // Most environments should use UMD; some (Karma) need the individual index files
    var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
    // Add package entries for angular packages
    ngPackageNames.forEach(setPackageConfig);

    var config = {
        map: map,
        packages: packages
    };
    System.config(config);
    /**** node_modules basic config! Do not touch ****/
})(this);

Answer №1

Upon investigating this issue further, I have discovered that the systemjs.config.js file used in their button quickstart guide differs from the one included in their button plunkr code sample. I have reached out to them for clarification on the correct method to be followed.

Answer №2

The reason why the @telerik packages were not working properly was due to them not being managed in SystemJS...

By referring to the Telerik documentation and checking out the plunkr links provided, you can find the necessary @telerik packages to include in the systemjs.config.js file.

For more information, visit: http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/


Upon examining the npm dependencies for each package, it appears that there are specific dependencies that need to be considered. If the Telerik team has not mentioned these dependencies, it is likely that they are automatically managed by the system.

This leads me to believe that I may not be using the systemJS file correctly. Any comments or suggestions are welcome to further clarify this issue.

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

Element not recognized: <my-company-form-extra> - have you properly registered this component?

I've been attempting to render a component using the is directive <template> <div> <v-tabs v-model="currentTab" fixed-tabs> <v-tab v-for="(item, i) in tabItems" :key="i">{{ item }} < ...

What's the best way to use the keyboard's enter key to mark my to-do list

I'm looking to update my todo list functionality so that pressing enter adds a new todo item, instead of having to click the button. <h1 style="text-align:center">Todo List</h1> <div class="container"> ...

Guide on incorporating file uploads in an Angular 6 project

I am currently working on creating a component where I have implemented a file upload function in a child component and am attempting to use that component's selector in another one. Here is my project structure: - upload : upload.component.html up ...

A single click is required for Observables to load on an HTML page

While working on my Angular web application, I encountered an issue with displaying data when using Observables and Subjects. Typically, when searching the Firebase DB, I use *ngFor="let myvar of _myvar | async" in my HTML to display the retrieve ...

No response was forthcoming

I have been trying to send a post request to my login endpoint, but I am not receiving any response. Despite thoroughly checking my code, I am unable to figure out why there is no response being sent back. My backend is built using Express in TypeScript. B ...

In TypeScript, how to refer to the type of the current class

Is there a way to reference the current class type in the type signature? This would allow me to implement something like the following: export class Component{ constructor(config?: { [field in keyof self]: any }) { Object.assign(this, config) ...

Ionic 2: Encountering issues resolving parameters for

I have encountered an issue while trying to utilize a Service across multiple pages within my Angular application, as it only seems to work on one page out of two. Here is the code snippet for my service: import { Component, Injectable, Inject } from &apo ...

The SetInterval function will continue to run within a web component even after the corresponding element has been removed from the

I am currently engaged in developing a straightforward application that coordinates multiple web components. Among these components, there is one that contains a setInterval function. Interestingly, the function continues to run even after the component it ...

Retrieve the attribute of a JSON data structure

I'm encountering an issue while trying to access the property of a JSON object named date in my Angular 6 project. Even though I assigned a variable to it, it keeps showing up as undefined. This is the snippet of code causing trouble: getHistorial(d ...

Follow the correct sequence when tapping the pipes and disregard the outcomes

I'm having trouble with executing tap functions in observables. In my scenario, I have a series of API requests that are dependent on each other. To handle this, I store the necessary data for the next request in class properties and use tap function ...

Typescript defines types for parameters used in callbacks for an event bus

Encountering a TypeScript error with our custom event bus: TS2345: Argument of type 'unknown' is not assignable to parameter of type 'AccountInfo | undefined'. Type 'unknown The event bus utilizes unknown[] as an argument for ca ...

The @media print rule for Angular 16 in the style.css file is not functioning properly

I'm currently working on an Angular component called ViewTask, which has a template that is rendered inside the app component. The app component also consists of a side nav bar. My goal is to only display the content inside the 'print-section&apo ...

Fire the props.onChange() function when the TextField component is blurred

Currently, I am in the process of developing a NumberField component that has unique functionality. This component is designed to remove the default 0 value when clicked on (onFocus), allowing users to input a number into an empty field. Upon clicking out ...

The TypeScript factory class anticipates an intersection

In my code, I have a class factory called pickSomething that generates a specific type based on a key provided from a ClassMap: class A { keya = "a" as const; } class B { keyb = "b" as const; } type ClassMap = { a: A b: B } c ...

Ways to modify this request in order to update the current status

How can I optimize these calls to avoid repeating the same sentence for refreshing the state? I'm not looking for a major overhaul, just some suggestions like putting this call inside a function and invoking it when needed... export const CategoriesPa ...

TypeORM: When generating a migration, a SyntaxError is thrown stating that an import statement cannot be used outside a

While configuring TypeORM in my NextJS TypeScript project, I encountered an issue where I received the error message: SyntaxError: Cannot use import statement outside a module when attempting to create migrations for my entities. ...

Retrieve the overall number of job openings from the Github Job API

I have successfully created an Angular application that mirrors the functionality of However, I encountered a limitation where only 50 positions are available per page, To fetch additional jobs beyond the initial 50, I need to append "?page=X" to another ...

Retrieving the component's values when utilizing the `<ng-content>` directive

Seeking a technique for accessing the values of a component when utilizing <ng-content>: import {Component} from '@angular/core'; @Component({ selector: 'home-page', template: `<person-box>{{name}}</person-box> & ...

Issues with implementing the link component in next.js

I've been working on a blog using next.js and I'm having trouble with the header links not working. I followed the next.js documentation to create the links, but whenever I reload the website and try to click the links, my console shows: "GET 40 ...

arranging multiple popular columns in an ng-template for an angular table

Incorporating angular 15.1 with angular material, I am utilizing the angular material Table component to present tables. Within my project, there are approximately 20 distinct tables that share 90% of the column definitions. As a result, I aim to centrali ...