imodeljs / imodeljs-samples

MIT License
33 stars 25 forks source link

How can i connect imodel with Angular app? #10

Closed jayshah-07 closed 4 years ago

jayshah-07 commented 4 years ago

I am using angular 7 and tried to convert basic-viewport-app to the angular app. Somehow I'm able to build it. while running the project, I got some errors related to the environment file.

I'm using npm run start:servers to run my project, setup is pretty much the same just I have replaced react with the angular project.

I'm not much familiar with Reactjs to trying to get this sample working in Angular.

If there is some sample app in Angular related to imodeljs, please share the link that can help to resolve my issue.

Error logs:

basic-angular-app@0.0.0 start:servers C:\Users\jay\Documents\workspace\imodeljs-samples\interactive-app\basic-angular-app env-cmd ./lib/webresources/config.json run-p "start:webserver" "start:backend"

Error: Unable to locate env file at default locations (./.env,./.env.js,./.env.json) at getEnvFile (C:\Users\jay\Documents\workspace\imodeljs-samples\interactive-app\basic-angular-app\node_modules\env-cmd\dist\get-env-vars.js:34:11) at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:834:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! basic-angular-app@0.0.0 start:servers: env-cmd ./lib/webresources/config.json run-p "start:webserver" "start:backend" npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the basic-angular-app@0.0.0 start:servers script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\jay\AppData\Roaming\npm-cache_logs\2019-12-06T12_36_09_203Z-debug.log

Please help me to resolve this issue.

calebmshafer commented 4 years ago

The error you pasted is an issue with the version of env-cmd that you're using. All of the samples should be using 8.0.2 as newer versions expect a .env file to exist. Can you check which version you're using?

calebmshafer commented 4 years ago

Closing this issue due to inactivity, feel free to re-open if this issue persists.