My webpack.config's loaders specified as following:
Code: Select all
[b]module: {
rules: [
{
test: /\.ts$/, use: isDevBuild ?
['awesome-typescript-loader?silent=true', 'angular2-template-loader', 'angular2-router-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' }
]
},[/b]
Code: Select all
Loading...
[color=#FF0000]ERROR [/color]in ./ClientApp/app/components/navmenu/navmenu.component.ts
Module parse failed: E:\Personal\SchoolQuizApp\SchoolQuiz\node_modules\awesome-typescript-loader\dist\entry.js?silent=true!E:\Personal\SchoolQuizApp\SchoolQuiz\node_modules\angular2-template-loader\index.js!E:\Personal\SchoolQuizApp\SchoolQuiz\node_modules\angular2-router-loader\src\index.js!E:\Personal\SchoolQuizApp\SchoolQuiz\ClientApp\app\components\navmenu\navmenu.component.ts [b]'return' outside of function (267:8)[/b]
You may need an appropriate loader to handle this file type.
| if (item.disabled) {
| event.preventDefault();
| return true;
| }
| // activate current item and deactivate active sibling if any
@ ./ClientApp/app/app.shared.module.ts 16:0-95
@ ./ClientApp/app/app.browser.module.ts
@ ./ClientApp/boot.browser.ts
@ multi event-source-polyfill webpack-hot-middleware/client?path=__webpack_hmr&dynamicPublicPath=true ./ClientApp/boot.browser.ts
In the SubmenuComponent >> Itemmenu function, not all code paths return a value. Is it not a bug? Can you please let me know how do I fix this error. I did spend 2 days on it so far.