Here is a rundown of common problems that may occur & its solutions!
npm installcommand is not working- React not updating after updating
server.js? - Error from
Terminal 2 - backend? - No response when starting the Express server?
- Got a
UnhandledPromiseRejectionWarningerror? - Got a
GAIA_IA02error? - Got a
GAIA_IQ11Specified field (Record_number) not founderror?
- Verify the Node.js & npm versions inside the
React_Workshop_by_Kintonefolder - Just installed Node.js? Verify you configured Node.js versions inside the
React_Workshop_by_Kintonefolder
- Mac:
nodenv local 14.5.0 - Windows:
nvm use 14.5.0
After making changes to server.js, be sure to restart the Express server On the Terminal 2 - backend!
- Stop the server:
ctrl + c - Start the server:
npm start
Then reload the browser showing the React App: localhost:3000
Do you see an error on .../React_Workshop_by_Kintone/backend/node_modules/node-fetch/lib/index.js:272 like the following?
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
^
FetchError: invalid json response body at https://r.kintone.com/notfound/subdomain.html reason: Unexpected token < in JSON at position 0
at /Users/g001494/Downloads/React_Workshop_by_Kintone/backend/node_modules/node-fetch/lib/index.js:272:32
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async /Users/g001494/Downloads/React_Workshop_by_Kintone/backend/server.js:43:24 {
type: 'invalid-json'
}
This error is related to your Kintone credentials.
- Verify that you have created a
.envfile with your Kintone credentials inside thebackendfolder - Verify the Kintone credentials are correct: Subdomain, App ID, and API Token
- Verify that the Kintone App is configured as done in the Create a Kintone Web Database App section
- Verify that the Kintone Web Database App is updated after generating the Kintone API Token
- Make sure you are inside the
backendfolder when starting the Express server.cd ~/Downloads/React_Workshop_by_Kintone/backendnpm start
- Verify that you have renamed
.env.exampleto.env- Be sure to enter your Subdomain, App ID, and API Token in the
.envfile
- Be sure to enter your Subdomain, App ID, and API Token in the
(node:5379) UnhandledPromiseRejectionWarning: FetchError: request to https://.kintone.com/k/v1/records.json?app= failed, reason: getaddrinfo ENOTFOUND .kintone.com
- It looks like Kintone API credentials are missing
- Be sure to enter your Subdomain, App ID, and API Token in the
.envfile - Confused? 🤔 → Check out the 🔐 Securely input your credentials in a
.envfile section
- Enter the App's API Token in
.envfile asAPITOKEN = "" - Be sure to hit the
savebutton & theUpdate Appbutton to implement the API Token change.
If you got this error, then your Record Number field's field code is not set to Record_number.
Error Message:
{"code":"GAIA_IQ11","id":"vgK7CfZlVME2T65afg8g","message":"Specified field (Record_number) not found."}Fix:
- Add the Record Number field to the App
- Set the field code to
Record_number - Save & Update the App