The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Storage API in UIKit app

Marouane MAJID
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 20, 2024

Hello Community,

I'm discovering the confluence integration, and I need to build an app that combines 3 elements:

  • confluence:globalSettings to store some app params using Storage API.
  • macro and its MacroConfig.

 

I have created a uiKit application as the MacroConfig is not supported by the CustomUI apps, in the other side I can't implement resolver to load and save parameters.
when deploying I have this issue.
Error: Error thrown in the snapshot context.
App code snapshot error: Snapshot error occurred: Error: window is not defined
Learn more about the snapshot context at https://go.atlassian.com/forge-snapshot-context.
Can you please advise ?

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Nikola Perisic
Community Champion
March 20, 2024

Welcome to the community @Marouane MAJID !

This question is more suitable for the development community, which is here https://community.developer.atlassian.com/

APKGuideHub
June 21, 2026

The An window is not defined error usually means that some code is being executed during Forge's snapshot phase, where browser-specific objects like window or document aren't available.

If you're building a UIKit app with MacroConfig, make sure any code that references window (or libraries that depend on it) only runs on the client side and not during module initialization.

Also, keep in mind that the Forge Storage API is typically accessed through backend functions (resolvers). If you're using a pure UIKit app, you may need to restructure your app so that storage operations are handled in Forge functions rather than directly in the UI. Another option is to avoid importing modules that expect a browser environment into code that's evaluated during the snapshot.

Could you share:

  • Your manifest.yml (especially the modules and function definitions)?

  • Where are you calling the Storage API?

  • The full stack trace from the deployment error?

That should make it easier to identify whether the issue is related to the snapshot context, an import, or the app structure.

DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events