cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error while Debugging SAM 2110 application in Visual Studio

kakkem
Participant
0 Likes
1,742

Hi Experts,

I am working on SAP Asset manager 2110 and trying to debug /run the application from Visual Studio Code.

While running the build task I am getting the below error.

ModuleNotFoundError: Module not found: Error: Can't resolve '@nativescript/core' in 'c:\Users\<User>\.vscode\extensions\sapse.vsc-extension-mdk-1.21.1\tools\application-bundler\build.definitions\SAPAssetManager\Extensions\ButtonStackModule\controls',ModuleNotFoundError: Module not found: Error: Can't resolve '@nativescript/core' in 'c:\Users\<User>\.vscode\extensions\sapse.vsc-extension-mdk-1.21.1\tools\application-bundler\build.definitions\SAPAssetManager\Extensions\ButtonStackModule\controls\ButtonStackPlugin',ModuleNotFoundError: Module not found: Error: Can't resolve '@nativescript/core' in 'c:\Users\<User>\.vscode\extensions\sapse.vsc-extension-mdk-1.21.1\tools\application-bundler\build.definitions\SAPAssetManager\Extensions\ButtonStackModule\controls\ButtonStackPlugin\android',ModuleNotFoundError: Module not found: Error: Can't resolve '@nativescript/core' in 'c:\Users\<User>\.vscode\extensions\sapse.vsc-extension-mdk-1.21.1\tools\application-bundler\build.definitions\SAPAssetManager\Extensions\ButtonStackModule\controls\ButtonStackPlugin\ios',ModuleNotFoundError: Module not found: Error: Can't resolve '@nativescript/core' in 'c:\Users\<User>\.vscode\extensions\sapse.vsc-extension-mdk-1.21.1\tools\application-bundler\build.definitions\SAPAssetManager\Extensions\HeaderFormCellModule\controls\HeaderFormCellPlugin',ModuleNotFoundError: Module not found: Error: Can't resolve '@nativescript/core' in 'c:\Users\<User>\.vscode\extensions\sapse.vsc-extension-mdk-1.21.1\tools\application-bundler\build.definitions\SAPAssetManager\Extensions\HeaderFormCellModule\controls\HeaderFormCellPlugin\android',ModuleNotFoundError: Module not found: Error: Can't resolve '@nativescript/core' in 'c:\Users\<User>\.vscode\extensions\sapse.vsc-extension-mdk-1.21.1\tools\application-bundler\build.definitions\SAPAssetManager\Extensions\HeaderFormCellModule\controls\HeaderFormCellPlugin\ios' undefined

Can anyone guide me on how to solve this issue and debug the application.

Looking forward to your guidance.

Thanks and Regards,

Krishna.

Accepted Solutions (0)

Answers (4)

Answers (4)

bill_froelich
Product and Topic Expert
Product and Topic Expert

I would guess that your VSCode preferences need to be updated to deploy using the MDK 6.0 format (es6).

Change the Mdk: TS Target value from es5 to es6 and retry your build task.

kakkem
Participant
0 Likes

Hi Bill,

Thank you so much for the help.

I have successfully build task with the above change but I am getting the below error while run and debugging (MDK launch on Android)

Please help further

Error:

Installing on device emulator-5554...

[33mUnable to apply changes on device: emulator-5554. Error is: The new package failed because it has specified that it is a test-only package and the caller has not supplied the #INSTALL_ALLOW_TEST flag..

[39m

[NSDebugAdapter] The tns command finished its execution with code 0.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Likes

I have never seen that error before.

I launch my clients from the terminal outside of VSCode (tns run android --emulator --no-hmr) to test my application and then if I need to debug I just attach from VSCode to the existing emulator that is already running. I personally prefer having the console output in a separate window outside of VSCode (usually on another monitor).

kakkem
Participant
0 Likes

Hi Bill,

I have managed to run the application on the emulator while attaching I am getting the below error on the output console.

Error:

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/definitions/bundle.20.js]

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found.

bundle.20.js:30532

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found.

index.js:217

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found.

index.js:217

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/definitions/bundle.20.js]

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found.

bundle.20.js:30532

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found.

index.js:217

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found.

index.js:217

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

mdk.trace.targetpath: Error: Property with name @sap.isLocal cannot be found.

index.js:217

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/definitions/bundle.20.js]

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found.

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/definitions/bundle.20.js]

Thu Jan 20 2022 14:11:22 GMT+0530 (IST) [COMMON] getTargetPathValue: Property with name @sap.isLocal cannot be found.

bundle.20.js:30532

fromNativeSource() is deprecated. Use ImageSource constructor instead. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

fromNativeSource() is deprecated. Use ImageSource constructor instead.

index.android.js:360

fromNativeSource() is deprecated. Use ImageSource constructor instead. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

fromNativeSource() is deprecated. Use ImageSource constructor instead.

index.android.js:360

fromNativeSource() is deprecated. Use ImageSource constructor instead. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

fromNativeSource() is deprecated. Use ImageSource constructor instead.

index.android.js:360

fromNativeSource() is deprecated. Use ImageSource constructor instead. [file:///data/data/com.sap.mobile.apps.assetmanager.release/files/app/vendor.js]

fromNativeSource() is deprecated. Use ImageSource constructor instead.

index.android.js:360

Please help.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Likes

Those may be normal. Did the debugger attach as expected and can you now set your breakpoints?

kakkem
Participant
0 Likes

I have setup Breakpoints but those are not hiting

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Likes

Please make sure you are using the latest version of the VS Code extension (v1.22.1). There were fixes for some breakpoint issues in this version.

RohitV76
Discoverer
0 Likes

Hi,

I am receiving similar errors while trying to deploy an MDK application in SAP BTP using Web IDE tool.

Please help me in resolving the same.

Thanks,

Rohit V.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Likes
Recommend posting a new question with your specific scenario / details / error message / environment
sk_ramkumar
Participant
0 Likes

Hi bill.froelich,

I am also facing the similar issue. I am using MDK version 1.24.0 and I have set TS Target to es6.

I have built my mdk client and I ran from my terminal the app is running successfully.

I set the Mdk: Debug App Root and I did Run Build Task, I could see my mbundle.js and bundle.js.map is created in the mdk client app folder. Whenever I change something in my app, I can see bundle is triggered automatically and I can see below log in my terminal,

Successfully transferred bundle.js.map on device 9F0FA4E9-027D-43D0-B5C9-628295EC4FA2.

Refreshing application on device 9F0FA4E9-027D-43D0-B5C9-628295EC4FA2...

Successfully synced application com.testexample.app on device 9F0FA4E9-027D-43D0-B5C9-628295EC4FA2.

Successfully transferred mbundle.js on device 9F0FA4E9-027D-43D0-B5C9-628295EC4FA2.

Refreshing application on device 9F0FA4E9-027D-43D0-B5C9-628295EC4FA2...


But nothing happened on the app. It dint change anything and no breakpoint is enabled as well.


Thanks,

Ram

rileycharkopwc
Explorer
0 Likes

I get a similar error when I try to bundle and this fix did not work for me.