stackblitz / stackblitz/sdk

`stackblitz.openProject` throws 403 error if `dependencies` contains `*`

Open
#24 0 comments 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

import stackblitz from '@stackblitz/sdk'; // 1.11.0

stackblitz.openProject({
    template: 'typescript',
    dependencies: {
        '@maskito/core': '*',
        '@maskito/kit': '*',
    },
    title: 'It will throw error!',
    files: {'index.html': 'Hello world!', 'index.ts': ''},
});

it throws

403 ERROR
The request could not be satisfied.

___
Request blocked. We can't connect to the server for this app or website at this time.
There might be too much traffic or a configuration error.
Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, 
you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
___

Generated by cloudfront (CloudFront)
Request ID: WAwVvJAM6OFyLM6Tm88Qtb-IXYqAdoJD6oTU--nw0AZLVr873aB4Qg==

It relates somehow to * inside dependencies-property.
Let's just change code a little bit:

import stackblitz from '@stackblitz/sdk'; // 1.11.0

stackblitz.openProject({
    template: 'typescript',
    dependencies: {
        '@maskito/core': 'latest',
        '@maskito/kit': 'latest',
    },
    title: 'No error',
    files: {'index.html': 'Hello world!', 'index.ts': ''},
});

It is obvious regression because it worked before.
We were using this approach in our Open Source library Maskito from March 2023 (and it worked correctly!).

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 by reproducing the reported 403 with stackblitz.openProject using '*' in dependencies, then compare it with the same project using 'latest'. Trace the openProject dependency handling and verify that wildcard versions no longer produce the 403 while the existing example still works.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.