Hi everyone,
I’m trying to build the hello world app, Part 2 - Call a Jira API, and I got stuck on the following error:
invocation: 05a96a93ede880b0 index.run
ERROR 23:06:54.527 05a96a93ede880b0 Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at Object.App [as type] (webpack:///src/index.jsx:13)
at /tmp/tunnel6YYymoAqAdRzU/index.js:29016:36
at async asyncMap (webpack:///node_modules/@forge/ui/out/reconcile.js:13)
at async /tmp/tunnel6YYymoAqAdRzU/index.js:28978:29
at async asyncMap (webpack:///node_modules/@forge/ui/out/reconcile.js:13)
at async /tmp/tunnel6YYymoAqAdRzU/index.js:29034:23
at async /tmp/tunnel6YYymoAqAdRzU/index.js:28907:31
Docker -v
Docker version 19.03.13-ce, build 4484c46
node -v
v12.20.2 (I also have the latest LTS version installed and throws the same error message)
package.json
{
"name": "forge-ui-starter",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"private": true,
"scripts": {
"lint": "./node_modules/.bin/eslint src/**/* || npm run --silent hook-errors",
"hook-errors": "echo '\\x1b[31mThe build failed because a Forge UI hook is being used incorrectly. Forge UI hooks follow the same rules as React Hooks but have their own API definitions. See the Forge documentation for details on how to use Forge UI hooks.\n' && exit 1"
},
"devDependencies": {
"eslint": "^6.5.1",
"eslint-plugin-react-hooks": "^2.1.2"
},
"dependencies": {
"@forge/api": "^0.7.0",
"@forge/ui": "^0.8.0",
"react": "^16.14.0"
}
}
I’ve installed react@^16.8.0 after running npm install @forge/api. However, I’ve tried without installing this dependency, and I got the same error.
When I print ${comments} only, I get “Number of comments on this issue: undefined”.
console.log(`Number of comments on this issue: ${comments}`);
It seems that the object “comments” is returning null, and I can’t access any of its properties. BTW, I’m running it on AWS EC2 Linux 2.
Has anyone experienced something similar that could help me on this one?
Thanks,
Ivan.