iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
623 stars 211 forks source link

Urgent Issue #61

Closed ashish1014 closed 4 years ago

ashish1014 commented 4 years ago

I am getting following Error: (node:61488) UnhandledPromiseRejectionWarning: TypeError: Cannot create property 'stack' on string 'Failed to discover URL for service identified by "iModelHubApi"' at RpcInvocation.fulfillRejected (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:145:26) at RpcInvocation.fulfillment.result.then (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:57:102) at process._tickCallback (internal/process/next_tick.js:68:7) (node:61488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 6) (node:61488) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:61488) UnhandledPromiseRejectionWarning: TypeError: Cannot create property 'stack' on string 'Failed to discover URL for service identified by "iModelHubApi"' at RpcInvocation.fulfillRejected (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:145:26) at RpcInvocation.fulfillment.result.then (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:57:102) at process._tickCallback (internal/process/next_tick.js:68:7) (node:61488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 12) (node:61488) UnhandledPromiseRejectionWarning: TypeError: Cannot create property 'stack' on string 'Failed to discover URL for service identified by "iModelHubApi"' at RpcInvocation.fulfillRejected (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:145:26) at RpcInvocation.fulfillment.result.then (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:57:102) at process._tickCallback (internal/process/next_tick.js:68:7) (node:61488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 18) (node:61488) UnhandledPromiseRejectionWarning: TypeError: Cannot create property 'stack' on string 'Failed to discover URL for service identified by "iModelHubApi"' at RpcInvocation.fulfillRejected (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:145:26) at RpcInvocation.fulfillment.result.then (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:57:102) at process._tickCallback (internal/process/next_tick.js:68:7) (node:61488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 24) (node:61488) UnhandledPromiseRejectionWarning: TypeError: Cannot create property 'stack' on string 'Failed to discover URL for service identified by "iModelHubApi"' at RpcInvocation.fulfillRejected (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:145:26) at RpcInvocation.fulfillment.result.then (D:\Ashish\simple-viewer-app-master\node_modules\@bentley\imodeljs-common\lib\rpc\core\RpcInvocation.js:57:102) at process._tickCallback (internal/process/next_tick.js:68:7) (node:61488) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 30)

Please check do needfull


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

ColinKerr commented 4 years ago

Can you give a little bit more detail?

What were you doing when you got this error in the sample application? Are you running in electron or the web browser? How did you start the app? Did you follow the instructions here: https://github.com/imodeljs/imodeljs-samples/blob/master/README.md#sample-interactive-apps

ColinKerr commented 4 years ago

what seems to be failing is the call to get the URL for the iModelHub which would then be used to download the URL. The failing request should have a url like: https://buddi.bentley.com/WebService/GetUrl/?url=iModelHubApi&region=0

The result of this call will include the url for the iModelHub.

ColinKerr commented 4 years ago

Do you have 'imjs_buddi_url' or 'imjs_buddi_resolve_url_using_region' set in your config?

sainiroop commented 4 years ago

@ashish752 , can you please share the contents of your config.json file (under lib/webresources)? I would leave out your client-id if you have one.

calebmshafer commented 4 years ago

What version of the iModel.js libraries is Simple Viewer App using? Also, are you using the Simple Viewer App from the iModel.js Samples repo or from a different repository?

calebmshafer commented 4 years ago

Is the repository you downloaded it from, https://github.com/imodeljs/simple-viewer-app? Can you copy the "dependencies" from the package.json?

calebmshafer commented 4 years ago

Can you try downloading the iModel.js Samples repo and testing the same thing from the "interactive-app/simple-viewer-app" folder?

The individual Simple Viewer App repo hasn't been updated in several months and has been archived.

calebmshafer commented 4 years ago

Yes, you can download a zip of the iModel.js Samples repository which contains the newer version of the Simple Viewer App and try it out.

I'm not sure what the issue is yet but wanted to see if you can reproduce the error with the latest code so we can narrow down what's causing the error.

In addition, can you provide the full steps you used to get the error? Such as,

  1. Download a zip of the Simple Viewer App repo
  2. npm install the repo
  3. Update the src/common/config.json
  4. npm run build
  5. npm run start:servers
calebmshafer commented 4 years ago

When you tried to install again, when on an open network, did you delete the node_modules directory first? Or just re-ran the npm install?