imodeljs / desktop-starter

An iTwin.js Desktop starter app
https://itwinjs.org
MIT License
21 stars 12 forks source link

× Unhandled Rejection (Error): Not running under Electron #51

Closed farhantaj90 closed 3 years ago

farhantaj90 commented 3 years ago

× Unhandled Rejection (Error): Not running under Electron this error is coming after running on localhost.

apdevac commented 3 years ago

Is there any update on this issue? I am also getting the same error and looking for a solution

williamkbentley commented 3 years ago

How are you starting the app? npm run start should launch an Electron window. This app should not be viewed in a browser.

williamkbentley commented 3 years ago

Alternatively, to npm run start, you can run: npm run start:frontend (to start the CRA web server) in one terminal and in another terminal: npm run electron:debug (to start the Electron window).

npm run start wraps those two scripts into one command.

williamkbentley commented 3 years ago

My hunch is the backend did not get started correctly, but the error message was too quick to notice. As npm run start starts the frontend and backend in parallel, some of the logging can easily be missed. I re-wrote the way the backend is initialized w.r.t Client Id. I hope this will solve issues like this with clearer error messaging. If no more info is provided, I'm going to close this issue.