Nativescript-angular tns run fail with ERROR Error: Can't resolve all parameters for ApplicationModule - nativescript-angular

I have updated my project to angular 9, ng serve works fine and I have no error. Nativescript builds successfully but while installing on emulator fails with following stack error.
I have tried pollyfills fixes and everything .Nothing fixed my problem.I have updated core-js to 3.6.5. Also imported 'import './pollyfills' on top of main.ts .That too didn't fix my problem.
package.json
"dependencies": {
"#angular-devkit/build-angular": "~0.901.7",
"#angular/animations": "~9.1.0",
"#angular/cdk": "^9.2.4",
"#angular/common": "~9.1.0",
"#angular/compiler": "~9.1.0",
"#angular/compiler-cli": "^9.1.10",
"#angular/core": "~9.1.0",
"#angular/fire": "^5.2.1",
"#angular/flex-layout": "^9.0.0-beta.31",
"#angular/forms": "~9.1.0",
"#angular/material": "^9.2.4",
"#angular/platform-browser": "~9.1.0",
"#angular/platform-browser-dynamic": "~9.1.0",
"#angular/router": "~9.1.0",
"#nativescript/angular": "^9.0.0",
"#nativescript/core": "~6.5.0",
"#nativescript/schematics": "^1.0.0",
"#nativescript/theme": "~2.2.1",
"#ngx-translate/http-loader": "^4.0.0",
"#nstudio/nativescript-checkbox": "^1.0.0",
"#stomp/ng2-stompjs": "^7.2.0",
"#swimlane/ngx-charts": "^12.1.0",
"#types/googlemaps": "^3.38.1",
"acorn": "^6.1.1",
"angular-gridster2": "^8.2.0",
"angular2-uuid": "^1.1.1",
"chart.js": "^2.9.3",
"core-js": "^3.6.5",
"fast-text-encoding": "^1.0.0",
"firebase": "^7.0.0",
"font-awesome": "^4.7.0",
"i": "^0.3.6",
"jwt-decode": "^2.2.0",
"linkifyjs": "^2.1.8",
"material-design-icons": "^3.0.1",
"material-icons": "^0.3.1",
"moment": "^2.24.0",
"moment-timezone": "^0.5.25",
"nativescript-angular": "^8.21.0",
"nativescript-couchbase-plugin": "^0.9.6",
"nativescript-feedback": "^1.3.12",
"nativescript-fontawesome": "^1.0.0",
"nativescript-ng2-fonticon": "^1.3.4",
"nativescript-ngx-fonticon": "^6.0.3",
"nativescript-plugin-firebase": "^10.5.2",
"nativescript-ui-listview": "^8.2.0",
"nativescript-ui-sidedrawer": "^8.0.1",
"ng-pick-datetime": "^7.0.0",
"ng2-charts": "^2.3.0",
"ng2-translate": "^5.0.0",
"ngx-build-plus": "^8.0.3",
"ngx-cookie-service": "^3.0.3",
"ngx-logger": "^3.3.13",
"ngx-mat-select-search": "^2.1.1",
"ngx-select-ex": "^3.7.7",
"ngx-tinymce": "^7.0.0",
"npm": "^6.12.1",
"p-try": "^2.2.0",
"p3x-angular-compile": "^2020.4.192",
"reflect-metadata": "~0.1.12",
"rxjs": "~6.5.5",
"rxjs-compat": "^6.5.5",
"terser-webpack-plugin": "^1.3.0",
"tinymce": "^5.0.8",
"tns-core-modules": "^6.5.5",
"tslib": "^1.10.0",
"webpack": "^4.42.1",
"xlsx": "^0.15.2",
"zone.js": "^0.10.3"
},
"devDependencies": {
"#angular/cli": "^9.1.7",
"#angular/language-service": "^9.1.10",
"#nativescript/schematics": "~1.0.0",
"#nativescript/tslint-rules": "~0.0.5",
"#ngtools/webpack": "~9.1.0",
"#types/jasmine": "~3.3.13",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"#types/webpack-env": "^1.13.9",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.5",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"nativescript-dev-webpack": "~1.5.0",
"ng-mocks": "^9.0.0",
"node-sass": "^4.12.0",
"protractor": "~5.4.2",
"tns-platform-declarations": "^6.5.1",
"ts-node": "~8.2.0",
"tslint": "~5.17.0",
"typescript": "~3.8.3",
"uglifyjs-webpack-plugin": "^2.1.3",
"webpack-bundle-analyzer": "^3.3.2",
"#angular/compiler-cli": "~9.1.0"
},
"nativescript": {
"id": "com.sample.app",
"tns-android": {
"version": "6.5.1"
},
"tns-ios": {
"version": "6.5.1"
}
}
tnsconfig.tns.ts
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"strict": false,
"skipLibCheck": true,
"typeRoots": [
"node_modules/#types"
],
"lib": [
"es2018",
"dom",
"es6"
],
"paths": {
"core-js/es6/reflect": [
"node_modules/core-js/proposals/reflect-metadata"
],
"core-js/es6/*": [
"node_modules/core-js/es"
],
"core-js/es7/*": [
"node_modules/core-js/es"
],
"#src/*": [
"src/*.android.ts",
"src/*.ios.ts",
"src/*.tns.ts",
"src/*.web.ts",
"src/*"
]
}
},
"angularCompilerOptions": {
"enableIvy": false
}
}
ERROR:
Successfully transferred all files on device 49325649-F3BC-4A80-9109-BE05CB1C76BD.
Restarting application on device 49325649-F3BC-4A80-9109-BE05CB1C76BD...
CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0: HMR: Hot Module Replacement Enabled. Waiting for signal.
***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x100e3d02e NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x100e7de18 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3 0x1018795a2 ffi_closure_unix64_inner
4 0x101879fca ffi_closure_unix64
5 0x7fff23b9aa35 _CFXRegistrationPost1
6 0x7fff23b9a7a1 ___CFXNotificationPost_block_invoke
7 0x7fff23c988b3 -[_CFXNotificationRegistrar find:object:observer:enumerator:]
8 0x7fff23b9a0f6 _CFXNotificationPost
9 0x7fff2574bbf7 -[NSNotificationCenter postNotificationName:object:userInfo:]
10 0x7fff4808b5c2 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:]
11 0x7fff48090f05 -[UIApplication _runWithMainScene:transitionContext:completion:]
12 0x7fff477c576d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:]
13 0x7fff47cb44c1 _UIScenePerformActionsWithLifecycleActionMask
14 0x7fff477c627f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke
15 0x7fff477c5c8e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:]
16 0x7fff477c60ac -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]
17 0x7fff477c5941 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:]
18 0x7fff477c9f3f __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2
19 0x7fff47bd8c83 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:]
20 0x7fff47cd2dff _UISceneSettingsDiffActionPerformChangesWithTransitionContext
21 0x7fff477c9c5a __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke
22 0x7fff47cd2d02 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext
23 0x7fff477c9ac8 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]
24 0x7fff476206e7 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke
25 0x7fff4761f26c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:]
26 0x7fff47620411 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:]
27 0x7fff4808f599 -[UIApplication workspace:didCreateScene:withTransitionContext:completion:]
28 0x7fff47bfa7f5 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:]
29 0x7fff365d6165 -[FBSSceneImpl _callOutQueue_agent_didCreateWithTransitionContext:completion:]
30 0x7fff365fc4d8 __86-[FBSWorkspaceScenesClient sceneID:createWithParameters:transitionContext:completion:]_block_invoke.154
31 0x7fff365e0c45 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:]
JavaScript stack trace:
file: node_modules/#angular/compiler/fesm5/compiler.js:23397:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:23202:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:23094:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:22962:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:22769:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:22856:0
at forEach([native code])
at file: node_modules/#angular/compiler/fesm5/compiler.js:22834:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:22769:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:22856:0
at forEach([native code])
at file: node_modules/#angular/compiler/fesm5/compiler.js:22834:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:29076:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:29057:0
at file: node_modules/#angular/compiler/fesm5/compiler.js:29015:0
at file: node_modules/#angular/core/fesm5/core.js:28712:0
at file: node_modules/#nativescript/angular/platform-common.js:90:0
at file: node_modules/#nativescript/angular/platform-common.js:157:0
at file: node_modules/#nativescript/core/data/observable/observable.js:124:0
at [native code]
at file: node_modules/#nativescript/core/application/application.ios.js:171:0
at file: node_modules/#nativescript/core/application/application.ios.js:163:0
at [native code]
at file: node_modules/#nativescript/core/application/application.ios.js:36:0
at UIApplicationMain([native code])
at run(file: node_modules/#nativescript/core/application/application.ios.js:312:0)
at file: node_modules/#nativescript/angular/platform-common.js:211:0
at file: node_modules/#nativescript/angular/platform-common.js:112:0
at file: node_modules/#nativescript/angular/platform-common.js:92:0
at file:///app/bundle.js:11202:144
at ./main.tns.ts<…>
JavaScript error:
file: node_modules/#angular/compiler/fesm5/compiler.js:23397:0: JS ERROR Error: Can't resolve all parameters for ApplicationModule: (?).
NativeScript caught signal 11.
Native Stack:
1 0x100e8dbe1 sig_handler(int)
2 0x7fff5245a5fd _sigtramp
3 0x100000006
4 0x7fff5248eb85 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
5 0x7fff52492e58 _Unwind_RaiseException
6 0x7fff502568bd __cxa_throw
7 0x7fff513fbc44 _objc_exception_destructor(void*)
8 0x100e3d56f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
9 0x100e7de18 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
10 0x1018795a2 ffi_closure_unix64_inner
11 0x101879fca ffi_closure_unix64
12 0x7fff23b9aa35 _CFXRegistrationPost1
13 0x7fff23b9a7a1 ___CFXNotificationPost_block_invoke
14 0x7fff23c988b3 -[_CFXNotificationRegistrar find:object:observer:enumerator:]
15 0x7fff23b9a0f6 _CFXNotificationPost
16 0x7fff2574bbf7 -[NSNotificationCenter postNotificationName:object:userInfo:]
17 0x7fff4808b5c2 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:]
18 0x7fff48090f05 -[UIApplication _runWithMainScene:transitionContext:completion:]
19 0x7fff477c576d -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:]
20 0x7fff47cb44c1 _UIScenePerformActionsWithLifecycleActionMask
21 0x7fff477c627f __101-[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]_block_invoke
22 0x7fff477c5c8e -[_UISceneLifecycleMultiplexer _performBlock:withApplicationOfDeactivationReasons:fromReasons:]
23 0x7fff477c60ac -[_UISceneLifecycleMultiplexer _evalTransitionToSettings:fromSettings:forceExit:withTransitionStore:]
24 0x7fff477c5941 -[_UISceneLifecycleMultiplexer uiScene:transitionedFromState:withTransitionContext:]
25 0x7fff477c9f3f __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke_2
26 0x7fff47bd8c83 +[BSAnimationSettings(UIKit) tryAnimatingWithSettings:actions:completion:]
27 0x7fff47cd2dff _UISceneSettingsDiffActionPerformChangesWithTransitionContext
28 0x7fff477c9c5a __186-[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]_block_invoke
29 0x7fff47cd2d02 _UISceneSettingsDiffActionPerformActionsWithDelayForTransitionContext
30 0x7fff477c9ac8 -[_UIWindowSceneFBSSceneTransitionContextDrivenLifecycleSettingsDiffAction _performActionsForUIScene:withUpdatedFBSScene:settingsDiff:fromSettings:transitionContext:lifecycleActionType:]
31 0x7fff476206e7 __64-[UIScene scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke
JS Stack:
UIApplicationMain([native code])
at run(file: node_modules/#nativescript/core/application/application.ios.js:312:0)
at file: node_modules/#nativescript/angular/platform-common.js:211:0
at file: node_modules/#nativescript/angular/platform-common.js:112:0
at file: node_modules/#nativescript/angular/platform-common.js:92:0
at file:///app/bundle.js:11202:144
at ./main.tns.ts(file:///app/bundle.js:11207:34)
at __webpack_require__(file: src/webpack/bootstrap:816:0)
at checkDeferredModules(file: src/webpack/bootstrap:43:0)
at webpackJsonpCallback(file: src/webpack/bootstrap:30:0)
at anonymous(file:///app/bundle.js:2:61)
at evaluate([native code])
at moduleEvaluation
at
at asyncFunctionResume
at
at promiseReactionJob
Successfully synced application com.ngdesk.ngdesk2 on device 49325649-F3BC-4A80-9109-BE05CB1C76BD.

Please first of all try to upgrade your NativeScript Angular package from "nativescript-angular": "^8.21.0" to "nativescript-angular": "^9.0.0".
Then follow all the steps described here: Update guide Nativescript-Angular 9.
Besides if you have some more issues you can search through the NativeScript github issues to find many problems' solutions.
I managed to make it work with code sharing and Angular 9. It was not easy, at the beginning I got issues like you, even following the guide.
What I can say is: follow the wiki/guide very closely (for example at one point I did an invisible mistake in the ngcc.config.js of a stupid curly brace), and double check every single file:
the ngcc.config.js
the tsconfig.json
the tsconfig.tns.json
check very carefully the package.json:
you need to have exactly all the packages mentioned in the wiki,
and with the same version numbers
replace the imports to nativescript-angular with
#nativescript/angular and tns-core-modules with #nativescript/core
delete all the deep imports from
#nativescript/angular and #nativescript/core within youe project
(e.g.: import { somePackage } from '#nativescript/angular/deep/moreDeep' often
can be now replaced with import { somePackage } from '#nativescript/angular')
I got some issues with zone.js too, the app was starting with a
fatal error related to zone; updating zone.js package to the very
latest version solved everything
when you are sure you have fixed all of the above points, make sure to
clean everything and then rebuild:
rm -rf node_modules/ platforms/ package-lock.json hooks yarn.lock
tns platform remove android
tns platform remove iOS
tns platform add android
tns platform add iOS
Hope this will help! For me at the end with all of this I have a working Angular 9+NativeScript+Ivy compiler enabled in code sharing.

Related

Some problem with build my application on angular 13

I try to found solutions, on this problem...
Because, is not on my code...
Its is after update to latest npm and fs-extra...
Build at: 2022-03-16T13:33:13.718Z - Hash: aeac85e5815ce0c4 - Time: 7748ms
Error: node_modules/#angular-devkit/build-angular/node_modules/#angular-devkit/build-webpack/src/webpack-dev-server/index.d.ts:26:121 - error TS2307: Cannot find module '../../.
./core/src' or its corresponding type declarations.
26 declare const _default: import("#angular-devkit/architect/src/internal").Builder<WebpackDevServerBuilderSchema & import("../../../core/src").JsonObject>;
~~~~~~~~~~~~~~~~~~~
Error: node_modules/#angular-devkit/build-angular/node_modules/#angular-devkit/build-webpack/src/webpack/index.d.ts:30:116 - error TS2307: Cannot find module '../../../core/src'
or its corresponding type declarations.
30 declare const _default: import("#angular-devkit/architect/src/internal").Builder<RealWebpackBuilderSchema & import("../../../core/src").JsonObject>;
~~~~~~~~~~~~~~~~~~~
Error: node_modules/#angular-devkit/build-angular/node_modules/webpack-dev-middleware/types/index.d.ts:204:27 - error TS2694: Namespace '"fs"' has no exported member 'StatSyncFn
'.
204 statSync?: import("fs").StatSyncFn;
Somebody having like solutions on this ?...
I have try to re-install webpack-server, all indicated...
Nothing to do...I don't understound why that's not working...
How to proceed...?
Thanks to us for your help...
Here to package.json
"name": "bonrefil",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"#angular/animations": "~13.0.0",
"#angular/cdk": "^13.2.6",
"#angular/common": "~13.0.0",
"#angular/compiler": "~13.0.0",
"#angular/core": "~13.0.0",
"#angular/forms": "~13.0.0",
"#angular/material": "^13.2.6",
"#angular/platform-browser": "~13.0.0",
"#angular/platform-browser-dynamic": "~13.0.0",
"#angular/router": "~13.0.0",
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.7.2",
"fs-extra": "^10.0.1",
"image-to-base64": "^2.2.0",
"jquery": "^3.6.0",
"popper.js": "^1.16.1",
"rxjs": "~7.4.0",
"tslib": "^2.3.0",
"uuid": "^8.3.2",
"xdata": "^2.1.17",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^13.2.6",
"#angular-devkit/core": "^13.2.6",
"#angular/cli": "~13.0.3",
"#angular/compiler-cli": "~13.0.0",
"#nguniversal/builders": "^13.0.2",
"#types/jasmine": "~3.10.0",
"#types/jquery": "^3.5.9",
"#types/node": "^12.20.46",
"#types/uuid": "^8.3.4",
"#types/webpack-dev-server": "^4.7.2",
"bootstrapvalidator": "^0.5.4",
"jasmine-core": "~3.10.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.4.3",
"webpack": "^5.70.0",
"webpack-dev-middleware": "^5.3.1",
"webpack-dev-server": "^4.7.4"
}
}
You need to update your #types/node version. If you update to at least 15.12.2 it should now work: See https://app.renovatebot.com/package-diff?name=#types%2Fnode&from=13.13.5&to=15.12.2

Angular 10 Warning: Entry point 'devextreme-angular..' contains deep import into module

I'm trying to build my angular app but I'm receiving this kind of warnings:
Warning: Entry point 'devextreme-angular/ui/data-grid' contains deep imports into '{path to node modules}/node_modules/devextreme/ui/data_grid', '{path to node modules}/node_modules/devextreme/bundles/dx.all', '{path to node modules}/node_modules/devextreme/ui/filter_builder', '{path to node modules}/node_modules/devextreme/ui/form', '{path to node modules}/node_modules/devextreme/ui/popup'. This is probably not a problem, but may cause the compilation of entry points to be out of order.
Then I have this error:
Generating ES5 bundles for differential loading...
An unhandled exception occurred: Call retries were exceeded
These are my node and angular versions:
Angular CLI: 10.2.1
Node: 12.18.3
OS: win32 x64
Angular: 10.2.4
In the produced log file I have:
[error] Error: Call retries were exceeded
at ChildProcessWorker.initialize ({path to node modules}\node_modules\jest-worker\build\workers\ChildProcessWorker.js:193:21)
at ChildProcessWorker._onExit ({path to node modules}\node_modules\jest-worker\build\workers\ChildProcessWorker.js:274:12)
at ChildProcess.emit (events.js:315:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
This is the package.json file:
"dependencies": {
"#angular/animations": "^10.2.3",
"#angular/cdk": "^10.2.7",
"#angular/common": "^10.2.3",
"#angular/compiler": "^10.2.3",
"#angular/core": "^10.2.3",
"#angular/forms": "^10.2.3",
"#angular/material": "^10.2.7",
"#angular/material-moment-adapter": "^10.2.7",
"#angular/platform-browser": "^10.2.3",
"#angular/platform-browser-dynamic": "^10.2.3",
"#angular/platform-server": "^10.2.3",
"#angular/pwa": "^0.7.1",
"#angular/router": "^10.2.3",
"#angular/service-worker": "^10.2.3",
"#ngx-translate/core": "^11.0.1",
"#ngx-translate/http-loader": "^4.0.0",
"#syncfusion/ej2-angular-richtexteditor": "^18.3.52",
"#tinymce/tinymce-angular": "^4.1.0",
"ajv": "^6.9.1",
"angular-oauth2-oidc": "^10.0.0",
"cdk-table-exporter": "^9.0.2",
"chalk": "^3.0.0",
"classlist.js": "^1.1.20150312",
"core-js": "^2.5.4",
"devexpress-diagram": "^1.0.17",
"devexpress-gantt": "^1.0.10",
"devextreme": "^20.2.3",
"devextreme-angular": "20.2.3",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jquery": "^3.3.1",
"mat-table-exporter": "^9.0.2",
"moment": "^2.24.0",
"node": "^12.18.3",
"node-sass": "^4.9.2",
"popper.js": "^1.14.7",
"rxjs": "^6.5.5",
"rxjs-compat": "^6.0.0",
"tslib": "^1.10.0",
"web-animations-js": "^2.3.1",
"zone.js": "^0.10.3"
},
"devDependencies": {
"#angular-devkit/build-angular": "^0.1002.0",
"#angular-devkit/core": "^10.2.0",
"#angular-devkit/schematics": "^10.2.0",
"#angular/cli": "^10.2.0",
"#angular/compiler-cli": "^10.2.3",
"#angular/language-service": "^10.2.3",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "~6.0.1",
"devextreme-cli": "1.2.4",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"json-server": "^0.12.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "^3.9.6"
}
The build works fine on another machine with the same file. I can only think of something wrong in my node and angular/cli versions. I've already deleted node_modules folder and npm cache clean -f

Asp.net Angular Template application Npm update does not work

I am trying to follow the documentation found here however it is going well. All of the packages that gets created with the application are out of date such as the #angular/compiler which really the version at the time of this post is 6.0.2 not 4.2.5 as listed below in the generated packages.json.
Things to note.
Angular core 2.1 is installed
Latest version of NPM and Node are installed
Visual Studio 2017 Community is installed
Operating System: Windows 10
With the packages being this out of date there are many angular things I can take advantage of. I have been looking around however I have not found any solutions that work.
Things I have tried:
npm update
npm update -D && npm update -S
npm cache clean
npm install -g #angular/cli#latest
My dependencies:
{
"name": "TestingApp",
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"devDependencies": {
"#angular/animations": "4.2.5",
"#angular/common": "4.2.5",
"#angular/compiler": "4.2.5",
"#angular/compiler-cli": "4.2.5",
"#angular/core": "4.2.5",
"#angular/forms": "4.2.5",
"#angular/http": "4.2.5",
"#angular/platform-browser": "4.2.5",
"#angular/platform-browser-dynamic": "4.2.5",
"#angular/platform-server": "4.2.5",
"#angular/router": "4.2.5",
"#ngtools/webpack": "1.5.0",
"#types/chai": "4.0.1",
"#types/jasmine": "2.5.53",
"#types/webpack-env": "1.13.0",
"angular2-router-loader": "0.3.5",
"angular2-template-loader": "0.6.2",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.3",
"awesome-typescript-loader": "3.2.1",
"bootstrap": "3.3.7",
"chai": "4.0.2",
"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",
"isomorphic-fetch": "2.2.1",
"jasmine-core": "2.6.4",
"jquery": "3.2.1",
"json-loader": "0.5.4",
"karma": "1.7.0",
"karma-chai": "0.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-jasmine": "1.1.0",
"karma-webpack": "2.0.3",
"preboot": "4.5.2",
"raw-loader": "0.5.1",
"reflect-metadata": "0.1.10",
"rxjs": "5.4.2",
"style-loader": "0.18.2",
"to-string-loader": "1.1.5",
"typescript": "2.4.1",
"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"
}
}
Update dotnet --info
Product Information:
Version: 2.1.201
Commit SHA-1 hash: 7932dc6179
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17134
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.201\
Microsoft .NET Core Shared Framework Host
Version : 2.0.7
Build : 2d61d0b043915bc948ebf98836fefe9ba942be11

After upgrading to Angular 5 Compile error

I upgraded the project to latest stable Angular 5.0.0 from 4.0.2, With that, I updated all other dependencies as well.
(I am not sure if I should first upgrade to 4.4.6, Making Angular project working along with all dependencies is really become pain :(( )
Now when I run ng serve I am getting following error:
chunk {inline} inline.bundle.js (inline) 5.79 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 2.93 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 636 bytes [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 2.4 MB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 853 kB [initial] [rendered]
ERROR in Error: Could not resolve module ./users/users.module.ts relative to /Users/username/Projects/project-name/src/app/routes/routes.module.ts
at StaticSymbolResolver.getSymbolByModule (/Users/username/Projects/project-name/node_modules/#angular/compiler/bundles/compiler.umd.js:31826:30)
at StaticReflector.resolveExternalReference (/Users/username/Projects/project-name/node_modules/#angular/compiler/bundles/compiler.umd.js:30292:62)
at parseLazyRoute (/Users/username/Projects/project-name/node_modules/#angular/compiler/bundles/compiler.umd.js:28577:55)
at listLazyRoutes (/Users/username/Projects/project-name/node_modules/#angular/compiler/bundles/compiler.umd.js:28539:36)
at visitLazyRoute (/Users/username/Projects/project-name/node_modules/#angular/compiler/bundles/compiler.umd.js:29937:47)
at AotCompiler.listLazyRoutes (/Users/username/Projects/project-name/node_modules/#angular/compiler/bundles/compiler.umd.js:29905:20)
at AngularCompilerProgram.listLazyRoutes (/Users/username/Projects/project-name/node_modules/#angular/compiler-cli/src/transformers/program.js:157:30)
at Function.NgTools_InternalApi_NG_2.listLazyRoutes (/Users/username/Projects/project-name/node_modules/#angular/compiler-cli/src/ngtools_api.js:44:36)
at AngularCompilerPlugin._getLazyRoutesFromNgtools (/Users/username/Projects/project-name/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:246:66)
at Promise.resolve.then.then (/Users/username/Projects/project-name/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:542:50)
at process._tickCallback (internal/process/next_tick.js:109:7)
I looked into the Angular 5 change log, I don't see any change I need to make.
I have already updated all dependencies.
I looked for the error but didn't find much about it. Please share if any one run into similar issue and there is any better solution for upgrading angular 5.0.0
"dependencies": {
"#agm/core": "^1.0.0-beta.2",
"#angular/animations": "^5.0.0",
"#angular/common": "^5.0.0",
"#angular/compiler": "^5.0.0",
"#angular/core": "^5.0.0",
"#angular/forms": "^5.0.0",
"#angular/http": "^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",
"#asymmetrik/ngx-leaflet": "^2.5.1",
"#ngx-translate/core": "^8.0.0",
"#ngx-translate/http-loader": "2.0.0",
"#toverux/ngsweetalert2": "^2.0.1",
"#types/leaflet": "^1.2.1",
"ag-grid": "^14.0.1",
"ag-grid-angular": "^14.0.0",
"angular-2-dropdown-multiselect": "^1.6.0",
"angular-tree-component": "^5.1.2",
"angular2-datatable": "^0.6.0",
"angular2-jwt": "^0.2.3",
"angular2-text-mask": "^8.0.0",
"angular2-toaster": "^4.0.1",
"bootstrap": "^3.3.7",
"chart.js": "^2.5.0",
"classlist.js": "^1.1.20150312",
"codemirror": "5.31.0",
"core-js": "2.5.1",
"easy-pie-chart": "2.1.7",
"flot": "flot/flot#v0.8.3",
"font-awesome": "4.7.0",
"fullcalendar": "3.6.2",
"intl": "1.2.5",
"jqcloud2": "2.0.3",
"jquery": "3.2.1",
"jquery-slimscroll": "1.3.8",
"jquery-sparkline": "2.4.0",
"jquery.browser": "0.1.0",
"jquery.flot.tooltip": "github:krzysu/flot.tooltip",
"leaflet": "^1.2.0",
"lodash": "4.17.4",
"modernizr": "3.5.0",
"moment": "2.19.1",
"ng2-charts": "1.6.0",
"ng2-dnd": "4.2.0",
"ng2-file-upload": "1.2.1",
"ng2-img-cropper": "0.9.0",
"ng2-select": "1.2.0",
"ng2-table": "1.3.2",
"ng2-tag-input": "1.4.1",
"ng2-validation": "4.2.0",
"ngx-bootstrap": "^2.0.0-beta.8",
"ngx-color-picker": "4.5.0",
"ngx-infinite-scroll": "0.6.1",
"node-sass": "^4.6.0",
"rxjs": "^5.5.0",
"screenfull": "3.3.2",
"simple-line-icons": "2.4.1",
"spinkit": "1.2.5",
"summernote": "0.8.8",
"sweetalert": "2.0.8",
"sweetalert2": "^6.11.2",
"ts-helpers": "1.1.2",
"tslib": "^1.8.0",
"weather-icons": "github:erikflowers/weather-icons",
"web-animations-js": "2.3.1",
"webpack": "^3.8.1",
"zone.js": "0.8.18"
},
"devDependencies": {
"#angular/cli": "^1.3.1",
"#angular/compiler-cli": "^5.0.0",
"#types/codemirror": "0.0.50",
"#types/jasmine": "2.6.3",
"#types/lodash": "4.14.82",
"#types/node": "8.0.49",
"codelyzer": "4.0.1",
"jasmine-core": "2.8.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "1.7.1",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"karma-read-json": "1.1.0",
"loaders.css": "0.1.2",
"napa": "3.0.0",
"protractor": "5.2.0",
"ts-node": "3.3.0",
"tslint": "5.8.0",
"typescript": "2.4.2",
"uglifyjs-webpack-plugin": "^1.0.1",
"webdriver-manager": "12.0.6"
}
I'm assuming that you are trying to lazy-load a module from users/users.module.ts in your routing config.
I was seeing the same issue. For me, removing the .ts extension from the loadChildren route config solved the problem:
e.g.
{ path: 'main', loadChildren: 'app/main/index.ts#MainModule'}
Becomes:
{ path: 'main', loadChildren: 'app/main/index#MainModule'}
I have the same issue. I am lazily loading modules. This was working fine, until I tried to use Angular Material components, some of which had compatibility issues. I upgraded all my #angular dependencies to 5.0.0. Now I get this AOT error.
const appRoutes: Routes = [
{ path: "**", component: NotFound404, pathMatch: 'full' },
{ path: 'expense', loadChildren: 'src/expense/expense.module#ExpenseModule' },
{ path: 'user', loadChildren: 'src/user/user.module#UserModule' }
];
The strange thing is if I comment the last 2 lines in my routes, which are loading the modules lazily, my project runs fine. If I uncomment, then webpack recompiles my project fine and everything runs fine too.
I am not able to figure it out.
Any one have solution to this problem?
Thanks.
Deepak

Duplicate Identifier Error Popper.js

I have been unable to fix this error or determine the cause. No code has changed, so I assume it is a result of an NPM package being updated. Here is the error log to the console. This is for an Angular2 application.
ERROR in [at-loader] ./node_modules/#types/popper.js/index.d.ts:6:19
TS2300: Duplicate identifier 'Popper'.
ERROR in [at-loader] ./node_modules/#types/popper.js/index.d.ts:89:15
TS2300: Duplicate identifier 'Popper'.
ERROR in [at-loader] ./node_modules/#types/popper.js/index.d.ts:104:3
TS2300: Duplicate identifier 'default'.
ERROR in [at-loader] ./node_modules/popper.js/index.d.ts:8:19
TS2300: Duplicate identifier 'Popper'.
ERROR in [at-loader] ./node_modules/popper.js/index.d.ts:113:15
TS2300: Duplicate identifier 'Popper'.
ERROR in [at-loader] ./node_modules/popper.js/index.d.ts:120:43
TS2694: Namespace 'Popper' has no exported member 'ReferenceObject'.
ERROR in [at-loader] ./node_modules/popper.js/index.d.ts:130:3
TS2300: Duplicate identifier 'default'.
Here is my tsconfig.json file:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true,
"typeRoots": [
"../node_modules/#types/"
]
},
"compileOnSave": true,
"exclude": [
"node_modules/*",
"**/*-aot.ts"
]
}
Here is my package.json file as you requested. I think the problem is that one of these package is upgrading to an unstable version, because I had not been receiving this error in the past:
{
"name": "truerec-verifier-landing-page",
"version": "1.0.0",
"description": "TrueRec verifier web.",
"scripts": {
"start": "webpack-dev-server --inline --progress --port 8080",
"test": "karma start karma.webpack.conf.js",
"build": "rm -rf dist/* && webpack --config config/webpack.prod.js --bail",
"dev": "rm -rf dist/* && webpack --config config/webpack.dev.js --bail"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"#angular/animations": "~4.1.1",
"#angular/common": "~4.1.1",
"#angular/compiler": "~4.1.1",
"#angular/compiler-cli": "~4.1.1",
"#angular/core": "~4.1.1",
"#angular/forms": "~4.1.1",
"#angular/http": "~4.1.1",
"#angular/platform-browser": "~4.1.1",
"#angular/platform-browser-dynamic": "~4.1.1",
"#angular/platform-server": "~4.1.1",
"#angular/router": "~4.1.1",
"#angular/tsc-wrapped": "~4.1.1",
"#angular/upgrade": "~4.1.1",
"angular-in-memory-web-api": "~0.3.1",
"angular2-recaptcha": "^0.4.1",
"core-js": "^2.4.1",
"jquery": "^3.2.1",
"js-sha3": "^0.5.7",
"ng2-pdf-viewer": "^1.1.0",
"ng2-semantic-ui": "^0.8.4",
"ng2-toastr": "^4.1.2",
"ngx-cookie": "^1.0.0",
"pdfjs-dist": "^1.8.430",
"rxjs": "5.0.1",
"zone.js": "0.8.12"
},
"devDependencies": {
"#types/google.analytics": "0.0.33",
"#types/jasmine": "2.5.36",
"#types/node": "^6.0.45",
"angular2-template-loader": "^0.6.0",
"awesome-typescript-loader": "^3.0.4",
"css-loader": "^0.26.1",
"extract-text-webpack-plugin": "2.0.0-beta.5",
"file-loader": "^0.9.0",
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.16.1",
"jasmine": "~2.4.1",
"jasmine-core": "~2.4.1",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.2",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.1",
"less": "^2.7.2",
"less-loader": "^4.0.4",
"lodash": "^4.16.2",
"null-loader": "^0.1.1",
"phantomjs-prebuilt": "2.1.13",
"protractor": "~4.0.14",
"raw-loader": "^0.5.1",
"request": "^2.81.0",
"resolve-url-loader": "^2.0.2",
"rimraf": "^2.5.4",
"style-loader": "^0.13.1",
"to-string-loader": "^1.1.5",
"tslint": "^3.15.1",
"typescript": "~2.3.0",
"webpack": "2.2.1",
"webpack-dev-server": "2.4.1",
"webpack-merge": "^3.0.0"
},
"repository": {}
}
I ran into this same issue yesterday when I cloned a repo onto a new machine and did an NPM install to get the packages - same exact error. My project is also using the ng2-semantic-ui package. Ng2-semantic-ui has a dependency on both Popper.js and #types\popper (typescript definitions).
"dependencies": {
"#angular/common": "^4.1.0",
"#angular/core": "^4.1.0",
"#angular/forms": "^4.1.0",
"#types/popper.js": "^1.8.0",
"element-closest": "^2.0.2",
"popper.js": "^1.0.6",
"rxjs": "^5.0.1"
},
I was able to compare the packages of my original with the new an I noticed that popper.js now has typescript definitions included (index.d.ts). It looks like they were introduced in 1.11.1 - I have 1.10.8 on my working version and 1.12.1 on my machine with the "broken" build (same error as yours).
The source of the error and duplicate identifiers are the duplicate type definitions for popper.js.
I'm going to open up an issue over on ng2-semantic-ui and see if we can get the dependency on #types/popper.js removed as it's not needed with the latest version of popper.js. In the mean time, I removed the #types/popper.js and was able to get a good build. Hope this helps!
UPDATE: This issue looks to be resolved in a hotfix 3 weeks ago in version 0.9.4 (issue 195) (https://github.com/edcarroll/ng2-semantic-ui/releases/tag/v0.9.4). Update your dependency version in your package.json and you should be good to go.

Resources