stackblitz / stackblitz/sdk

`openProject` API always opens StackBlitz homepage when used in a Figma plugin

Open
#28 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
50
Forks
32
PR merge metrics
No merged PRs in 30d

Description

I encountered an issue with the openProject API of the StackBlitz SDK while creating a Figma plugin. The plugin renders a button that, when clicked, is supposed to create a project using the StackBlitz SDK. However, instead of opening the specified project, it always redirects to the StackBlitz homepage.

The implementation is based on your official example:
https://stackblitz.com/edit/sdk-create-project-with-npm-ts?file=index.ts

Steps to Reproduce:

  1. Clone the repository: GitHub Repo Link

  2. Build the plugin:

    $ npm run build
    

    This will generate a manifest.json file and a build/ directory containing the JavaScript bundle(s) for the plugin.

    To watch for code changes and rebuild the plugin automatically:

    $ npm run watch
    
  3. Install the plugin in Figma:

    1. In the Figma desktop app, open a Figma document.
    2. Search for and run Import plugin from manifest… via the Quick Actions search bar.
    3. Select the manifest.json file that was generated by the build script.
  4. Click on the "Create StackBlitz project" button in the plugin.
    Image

Expected Behavior:
The openProject API should create and display the specified project in StackBlitz.

Actual Behavior:
The openProject API always redirects to the StackBlitz homepage instead of creating the project.

Additional Notes:

  • The issue might be related to restrictions in Figma’s environment (e.g., iframe sandboxing or CORS).
  • There’s also a CodeSandbox link in the plugin, which works as expected.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the official SDK example's index.ts and the reproduction repository; run npm run build, install the generated manifest.json in the Figma desktop app, and click the button. Compare the generated build bundle and the Figma plugin behavior with the expected openProject call. Done means the specified project opens in StackBlitz instead of the homepage.

Written by the indexing model from the issue text.

Assessment

Tech stack
figma, typescript
Domain
api, desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.