Here is a rundown of common problems that may occur & its solutions!
npm install
command is not working- React not updating after updating
server.js
? - Error from
Terminal 2 - backend
? - No response when starting the Express server?
- Got a
UnhandledPromiseRejectionWarning
error? - Got a
GAIA_IA02
error? - Got a
GAIA_IQ11
Specified field (Record_number) not found
error?
- Verify the Node.js & npm versions inside the
React_Workshop_by_Kintone
folder - Just installed Node.js? Verify you configured Node.js versions inside the
React_Workshop_by_Kintone
folder
- 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
.env
file with your Kintone credentials inside thebackend
folder - 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
backend
folder when starting the Express server.cd ~/Downloads/React_Workshop_by_Kintone/backend
npm start
- Verify that you have renamed
.env.example
to.env
- Be sure to enter your Subdomain, App ID, and API Token in the
.env
file
- 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
.env
file - Confused? 🤔 → Check out the 🔐 Securely input your credentials in a
.env
file section
- Enter the App's API Token in
.env
file asAPITOKEN = ""
- Be sure to hit the
save
button & theUpdate App
button 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