Hello
I’m trying to call remote server api using invokeRemote function from @forge/bridge package but I’m getting the following error:
Error: Resolver has no definition for 'undefined'
Here is my manifest.yml file:
modules:
jira:issueActivity:
- key: sastrify-support-app-issue-activity
resource: activity
resolver:
endpoint: remote-jira-endpoint
render: native
title: Sastrify Support
jira:issueContext:
- key: sastrify-support-app-issue-context
resource: context
resolver:
function: resolver
render: native
title: Sastrify Support
description: Sastrify Support
label: Sastrify Support
function:
- key: resolver
handler: index.handler
endpoint:
- key: remote-jira-endpoint
remote: remote-jira-service
auth:
appUserToken:
enabled: true
appSystemToken:
enabled: true
resources:
- key: activity
path: src/frontend/activity/activity.jsx
- key: context
path: src/frontend/context/context.jsx
permissions:
scopes:
- read:app-system-token
- read:app-user-token
remotes:
- key: remote-jira-service
baseUrl: https://heavily-intimate-urchin.ngrok-free.app
auth:
appSystemToken:
enabled: true
appUserToken:
enabled: true
operations:
- compute
app:
runtime:
name: nodejs20.x
And this is the UI:
import React from 'react';
import ForgeReconciler, { Stack, Text } from '@forge/react';
import { invokeRemote } from "@forge/bridge";
import { Modal } from './components';
const SastrifySupportTab = () => {
const handleFormSubmission = async (data) => {
const response = await invokeRemote({
path: '/jira-integration-service',
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
});
console.log(response);
};
return (
<Stack alignInline="center" space="space.0">
<Text>Test</Text>
<Modal handleFormSubmission={handleFormSubmission} />
</Stack>
);
};
ForgeReconciler.render(
<React.StrictMode>
<SastrifySupportTab />
</React.StrictMode>
);