jQuery UI Widgets Forums Getting Started angular5TemplateCore

This topic contains 3 replies, has 2 voices, and was last updated by  Ivo Zhulev 6 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • angular5TemplateCore #99510

    lebarillier
    Participant

    hi,
    i’m using an angular5TF project and i can’t use jqwidget.
    i try to use a combobox but everytime this error occured:

    ERROR in ./~/jqwidgets-scripts/jqwidgets-ts/angular_jqxComboBox.ts
    Module parse failed: C:\Users\Lebarillierq\source\repos\SysInstallWeb\SysInstallWeb\node_modules\jqwidgets-scripts\jqwidgets-ts\angular_jqxComboBox.ts Unexpected token (17:8)
    You may need an appropriate loader to handle this file type.
    | 
    | const noop = () => { };
    | declare let JQXLite: any;
    | 
    | export const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR: any = {
     @ ./ClientApp/app/module/combo-box.module.ts 9:0-90
     @ ./ClientApp/app/components/head/head.module.ts
     @ ./ClientApp/app/app.module.shared.ts
     @ ./ClientApp/app/app.module.browser.ts
     @ ./ClientApp/boot.browser.ts
     @ multi event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true ./ClientApp/boot.browser.ts
    
    ERROR in [at-loader] ./node_modules/jqwidgets-scripts/jqwidgets-ts/angular_jqxComboBox.ts:106:23 
        TS2454: Variable 'areEqual' is used before being assigned.

    somebody can help me?

    little precision :
    i followed this tutorial :
    https://neelbhatt.com/2017/12/21/create-angular-5-application-using-net-core-2-0-template-in-visual-studio-2017/

    angular5TemplateCore #99562

    lebarillier
    Participant

    my package.json :

    
    {
      "dependencies": {
        "@angular/animations": "^5.0.0",
        "@angular/cli": "1.6.4",
        "@angular/common": "^5.0.0",
        "@angular/compiler": "^5.0.0",
        "@angular/compiler-cli": "^5.0.0",
        "@angular/core": "^5.0.0",
        "@angular/forms": "^5.0.0",
        "@angular/http": "^5.0.0",
        "@angular/language-service": "^5.0.0",
        "@angular/platform-browser": "^5.0.0",
        "@angular/platform-browser-dynamic": "^5.0.0",
        "@angular/platform-server": "^5.0.0",
        "@angular/router": "^5.0.0",
        "@ngtools/webpack": "1.10.2",
        "@types/jasmine": "~2.5.53",
        "@types/jasminewd2": "~2.0.2",
        "@types/node": "~9.6.0",
        "@types/webpack-env": "1.13.0",
        "angular2-template-loader": "0.6.2",
        "aspnet-prerendering": "^3.0.1",
        "aspnet-webpack": "^2.0.1",
        "awesome-typescript-loader": "3.2.1",
        "bootstrap": "3.3.7",
        "codelyzer": "~3.2.0",
        "css": "2.2.1",
        "css-loader": "0.28.4",
        "es6-shim": "0.35.3",
        "event-source-polyfill": "0.0.9",
        "expose-loader": "0.7.3",
        "extract-text-webpack-plugin": "2.1.2",
        "file-loader": "0.11.2",
        "html-loader": "0.4.5",
        "i18n": "^0.8.3",
        "isomorphic-fetch": "2.2.1",
        "jasmine-core": "~2.6.2",
        "jasmine-spec-reporter": "~4.1.0",
        "jquery": "3.2.1",
        "jqwidgets-scripts": "^5.4.0",
        "json-loader": "0.5.4",
        "karma": "~1.7.0",
        "karma-chrome-launcher": "~2.1.1",
        "karma-cli": "~1.0.1",
        "karma-coverage-istanbul-reporter": "^1.2.1",
        "karma-jasmine": "~1.1.0",
        "karma-jasmine-html-reporter": "^0.2.2",
        "preboot": "4.5.2",
        "protractor": "~5.1.2",
        "raw-loader": "0.5.1",
        "reflect-metadata": "0.1.10",
        "rxjs": "^5.5.2",
        "style-loader": "0.18.2",
        "to-string-loader": "1.1.5",
        "ts-node": "~3.2.0",
        "tslint": "~5.7.0",
        "typescript": "2.4.2",
        "url-loader": "0.5.9",
        "webpack": "2.5.1",
        "webpack-hot-middleware": "2.18.2",
        "webpack-merge": "4.1.0",
        "zone.js": "0.8.12"
      },
      "devDependencies": {
        "@angular/cli": "1.5.0",
        "@angular/compiler-cli": "^5.0.0",
        "@angular/language-service": "^5.0.0",
        "@types/jasmine": "~2.5.53",
        "@types/jasminewd2": "~2.0.2",
        "@types/node": "~6.0.60",
        "codelyzer": "~3.2.0",
        "jasmine-core": "~2.6.2",
        "jasmine-spec-reporter": "~4.1.0",
        "karma": "~1.7.0",
        "karma-chrome-launcher": "~2.1.1",
        "karma-cli": "~1.0.1",
        "karma-coverage-istanbul-reporter": "^1.2.1",
        "karma-jasmine": "~1.1.0",
        "karma-jasmine-html-reporter": "^0.2.2",
        "awesome-typescript-loader": "3.4.0",
        "angular2-template-loader": "0.6.2",
        "css-loader": "0.28.7",
        "img-loader": "^2.0.0",
        "raw-loader": "0.5.1",
        "protractor": "~5.1.2",
        "ts-node": "~3.2.0",
        "tslint": "~5.7.0",
        "typescript": "~2.4.2",
        "@types/chai": "4.0.1",
        "chai": "4.0.2",
        "karma-chai": "0.1.0",
        "karma-webpack": "2.0.3",
        "webpack": "3.8.1"
      },
      "license": "MIT",
      "name": "SysInstallWeb",
      "private": true,
      "scripts": {
        "ngc": "ngc -p ./tsconfig.json",
        "ng": "ng",
        "build": "ng build",
        "test": "ng test",
        "lint": "ng lint",
        "e2e": "ng e2e",
        "postinstall": "webpack --config webpack.config.vendor.js",
        "webpack": "webpack --config webpack.config.js --optimize-minimize",
        "start": "npm run ngc && npm run webpack"
      },
      "version": "0.0.0"
    }
    
    angular5TemplateCore #99586

    lebarillier
    Participant

    Here is my webpack.config.js file:

    
    const path = require('path');
    const webpack = require('webpack');
    const merge = require('webpack-merge');
    const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin;
    const CheckerPlugin = require('awesome-typescript-loader').CheckerPlugin;
    
    module.exports = (env) => {
        // Configuration in common to both client-side and server-side bundles
        const isDevBuild = !(env && env.prod);
        const sharedConfig = {
            stats: { modules: false },
            context: __dirname,
            resolve: { extensions: [ '.js', '.ts' ] },
            output: {
                filename: '[name].js',
                publicPath: 'dist/' // Webpack dev middleware, if enabled, handles requests for this URL prefix
            },
            module: {
                rules: [
                    { test: /\.ts$/, include: /ClientApp/, use: isDevBuild ? ['awesome-typescript-loader?silent=true', 'angular2-template-loader'] : '@ngtools/webpack' },
                    { test: /\.html$/, use: 'html-loader?minimize=false' },
                    { test: /\.css$/, use: [ 'to-string-loader', isDevBuild ? 'css-loader' : 'css-loader?minimize' ] },
                    { test: /\.(png|jpg|jpeg|gif|svg)$/, use: 'url-loader?limit=25000' }
                ]
            },
            plugins: [new CheckerPlugin()]
        };
    
        // Configuration for client-side bundle suitable for running in browsers
        const clientBundleOutputDir = './wwwroot/dist';
        const clientBundleConfig = merge(sharedConfig, {
            entry: { 'main-client': './ClientApp/boot.browser.ts' },
            output: { path: path.join(__dirname, clientBundleOutputDir) },
            plugins: [
                new webpack.DllReferencePlugin({
                    context: __dirname,
                    manifest: require('./wwwroot/dist/vendor-manifest.json')
                })
            ].concat(isDevBuild ? [
                // Plugins that apply in development builds only
                new webpack.SourceMapDevToolPlugin({
                    filename: '[file].map', // Remove this line if you prefer inline source maps
                    moduleFilenameTemplate: path.relative(clientBundleOutputDir, '[resourcePath]') // Point sourcemap entries to the original file locations on disk
                })
            ] : [
                // Plugins that apply in production builds only
                new webpack.optimize.UglifyJsPlugin(),
                new AngularCompilerPlugin({
                    tsConfigPath: './tsconfig.json',
                    entryModule: path.join(__dirname, 'ClientApp/app/app.module.browser#AppModule'),
                    exclude: ['./**/*.server.ts']
                })
            ])
        });
    
        // Configuration for server-side (prerendering) bundle suitable for running in Node
        const serverBundleConfig = merge(sharedConfig, {
            resolve: { mainFields: ['main'] },
            entry: { 'main-server': './ClientApp/boot.server.ts' },
            plugins: [
                new webpack.DllReferencePlugin({
                    context: __dirname,
                    manifest: require('./ClientApp/dist/vendor-manifest.json'),
                    sourceType: 'commonjs2',
                    name: './vendor'
                })
            ].concat(isDevBuild ? [] : [
                // Plugins that apply in production builds only
                new AngularCompilerPlugin({
                    tsConfigPath: './tsconfig.json',
                    entryModule: path.join(__dirname, 'ClientApp/app/app.module.server#AppModule'),
                    exclude: ['./**/*.browser.ts']
                })
            ]),
            output: {
                libraryTarget: 'commonjs',
                path: path.join(__dirname, './ClientApp/dist')
            },
            target: 'node',
            devtool: 'inline-source-map'
        });
    
        return [clientBundleConfig, serverBundleConfig];
    };
    
    angular5TemplateCore #99744

    Ivo Zhulev
    Participant

    Hi lebarillier,

    As said in the error this is loader related.
    Try using this loaders: (ofcourse install their NPM packages before)

    loaders:
            [
                {
                    test: /\.ts$/,
                    use: ['awesome-typescript-loader', 'angular2-template-loader'],
                    exclude: [/\.(spec|e2e)\.ts$/]
                },
                {
                    test: /\.html$/,
                    use: 'raw-loader'
                },
                {
                    test: /\.css$/,
                    use: ['to-string-loader', 'css-loader']
                },
                {
                    test: /\.(jpg|png|gif|svg|pdf|ico)$/,
                    use: [
                        {
                            loader: 'file-loader',
                            options: {
                                name: '../[path][name].[ext]'
                            }
                        }
                    ]
                }
            ]

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.