I followed the tutorials for Atlassian Forge: install docker, WSL 2 and npm, then install @forge/cli globally and forge create in my project directory, both done using Visual Studio Code. I’ve managed to deploy the app created by “Build Jira Hello World app” at Build a Jira hello world app (atlassian.com), and it works, but when I then try to recreate the very simple UI Kit examples at UI kit (atlassian.com), Forge lint complains in the tutorial about hooks, on code that I didn’t modify in the slightest:
…
const App = () => {
const [issue, setIssue] = useState(async () => {
const response = await api.asUser().requestJira(route'/rest/api/3/issue/{issueIdOrKey}');
^ERROR HERE: ',' expected
const issueData = response.text(); //... extract issueKey from response
return issueData;
});
…
Again, this is with default node.Js setup. I noticed that during the setup, it told me to use Node.js v10.0.0 or later. My node.js version is v16.14.2.
I have tried copying the devDependencies and dependencies packages from an example project and running npm install afterwards in hope of having the right version, but it didn’t fix anything. I’m unable to run forge deploy or forge tunnel because both of these require a linter without errors.
This is a pretty big problem. My boss has given me a deadline yesterday to figure out if we can use Forge for a client request by tomorrow (call an authenticated REST API on a different platform from a button in Jira), but while I’m optimistic about the chances of that working, I would like to test whether I can at least make such a request (meaning authenticating with the API and making a request while authenticated), and I cannot test this functionality before I have something I can start from. And I currently have nothing I can start from.