Closed developervishaldhawan closed 5 years ago
I am able to solve above issue. But salesforce returning callback URL and below JSON:
{"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect","address":"101.53.161.2","port":443}
Its not redirecting me to Index.html
Hi Vishal, this is happening because you have set the callback URL with an IP address that is not visible to Salesforce. Have you tried to use localhost like in my code sample?
Hi Philippe,
Thanks for responding. Above issue is solved, it was an issue with proxy URL.
The issue which currently i am facing is with Heroku deployment. I deployed app using Git integrated with VS code. When opening app with heroku provided url i am getting an application error. Below is the log related to this issue:
2018-04-18T07:31:03.290610+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-04-18T07_31_03_262Z-debug.log
2018-04-18T07:31:12.142261+00:00 heroku[web.1]: Starting process with command `npm run build-n-stasrt`
2018-04-18T07:31:14.935289+00:00 heroku[web.1]: Process exited with status 1
2018-04-18T07:31:14.945036+00:00 heroku[web.1]: State changed from starting to crashed
2018-04-18T07:31:14.842451+00:00 app[web.1]: npm ERR! missing script: build-n-stasrt
2018-04-18T07:31:14.854406+00:00 app[web.1]:
2018-04-18T07:31:14.854410+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-04-18T07:31:14.854412+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-04-18T07_31_14_844Z-debug.log
2018-04-18T07:31:47.300461+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/auth/login" host=myAppName.herokuapp.com request_id=78f70a40-76a2-45eb-8936-ede2b5aa8783 fwd="121.244.147.149" dyno= connect= service= status=503 bytes= protocol=https
2018-04-18T07:31:47.737836+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myAppName.herokuapp.com request_id=79427cf1-ed6a-42e8-bf8b-50b1f1d185d4 fwd="121.244.147.149" dyno= connect= service= status=503 bytes= protocol=https
I have changed callback URL in salesforce connected App and in server.js:
Other than this any other value i have to change in the code for production/heroku deployment?
Thanks
Looks like you are not using the correct NPM start script (you have a typo):
missing script: build-n-stasrt
Oh i see. But similar kind of issue after updating proc file.
2018-04-18T10:12:11.794638+00:00 app[web.1]: npm ERR!
2018-04-18T10:12:11.794795+00:00 app[web.1]: npm ERR! Failed at the myAppName@0.1.0 build-n-start script.
2018-04-18T10:12:11.794948+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-04-18T10:12:11.798752+00:00 app[web.1]:
2018-04-18T10:12:11.798995+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-04-18T10:12:11.799239+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-04-18T10_12_11_796Z-debug.log
2018-04-18T10:12:11.885411+00:00 heroku[web.1]: State changed from starting to crashed
2018-04-18T10:12:11.862550+00:00 heroku[web.1]: Process exited with status 1
2018-04-18T10:16:51.115469+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=myAppName.herokuapp.com request_id=a2a58dd8-4be2-41bb-acf7-e6c4aca39bd0 fwd="125.21.165.152" dyno= connect= service= status=503 bytes= protocol=https
2018-04-18T10:16:51.670436+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myAppName.herokuapp.com request_id=30e5fa54-5621-4978-961c-7ecb8e4351b4 fwd="125.21.165.152" dyno= connect= service= status=503 bytes= protocol=https
2018-04-18T10:20:41.156747+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/auth/login" host=myAppName.herokuapp.com request_id=f928bf4f-3a20-408d-adbd-7463b1c00c9a fwd="121.244.147.149" dyno= connect= service= status=503 bytes= protocol=https
2018-04-18T10:20:41.671455+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=myAppName.herokuapp.com request_id=96f8990d-1ac4-48c7-b929-f4fcbb5f2854 fwd="121.244.147.149" dyno= connect= service= status=503 bytes= protocol=https
Is that build issue? I am using "react-scripts build"
Below is my scripts section from package.json
"scripts": {
"start": "node server/server.js",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"build-n-start": "npm run build && npm run start",
"preinstall": "rm -fr public/assets",
"postinstall": "cp -r node_modules/@salesforce-ux/design-system/assets public"
}
Please suggest if any change required.
Thanks & Regards, Vishal Dhawan
Looks like your issue happens in the build-n-start script. Don't you have logs before that?
Also, could you try running just the build script to isolate the issue?
Closing stale issue.
Hi,
I am new to express and node. I have Configured and instantiated the client.
Here is my server.js code so far:
When starting the app using npm start and opening the URL: "http://localhost:8080/" in my browser, i am getting below error:
Please help if any thing missing in the above code.
Thanks & Regards, Vishal