Hey there,
anybody having issue with exporting macro to pdf? I updated my app yesterday and since then can’t get export to work, it was working previously. I’m getting out of ideas, please help.
I even created additional macro for testing, whenever I try to export to pdf I get the error “Error loading the extension!”. If I export to word, it all works good (and I see invocation in forge tunnel), but with pdf it looks like export function is not called at all (nothing in forge tunnel).
My code, anything I’m doing wrong?
Thank you.
manifest.yml
app:
id: <appid>
runtime:
name: nodejs20.x #also tried with nodejs22.x
modules:
...
macro:
- key: test-export
resource: test-export-resolver
render: native
title: Test export
layout: block #tried with block, inline, bodied, 'block', 'inline', 'bodied'
resolver:
function: resolver
adfExport:
function: test-adf-export
function:
...
- key: resolver
handler: index.handler
#tests:
- key: test-adf-export
handler: macroTestExport.testAdfExport
resources:
...
- key: test-export-resolver
path: src/frontend/testExportResolver.jsx
permissions:
scopes:
- read:space:confluence
- write:space:confluence
- read:confluence-space.summary
- read:confluence-user
- storage:app
- read:confluence-content.summary
- read:confluence-props
- write:confluence-props
- write:confluence-content
- read:custom-content:confluence
- write:custom-content:confluence
- delete:custom-content:confluence
- read:user:confluence
- read:page:confluence
external:
fetch:
backend:
...
images:
- "*.atlassian.com"
src/frontend/testExportResolver.jsx
import ForgeReconciler, { Text } from "@forge/react";
export const TestExportApp = () => {
console.debug('TestExportApp')
return (
<>
<Text>This is a macro for testing export </Text>
</>
)
}
ForgeReconciler.render(
<React.StrictMode>
<TestExportApp />
</React.StrictMode>
);
src/macroTestExport.js
//import { doc, p, } from '@atlaskit/adf-utils/builders';
export const testAdfExport = async (payload) => {
//tried also this way:
// return doc(
// p(`exportFunction`)
// //p(`Hello world! This is an export of type ${payload.exportType}.`)
// );
console.log("testAdfExport")
return {
"version": 1,
"type": "doc",
"content": [
{
"type": "panel",
"attrs": {
"panelType": "info"
},
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "Test export."
}
]
}
]
}
]
}
}