Join the Webstudio community

Updated 5 months ago

The maximum number of assets per project is 50.

At a glance

The community member has deployed webstudio locally and encountered an issue with the maximum asset limit, which they find quite low. The error message states that the maximum number of assets per project is 50. Another community member has solved the issue by modifying the upload.ts file and increasing the MAX_ASSETS_PER_PROJECT constant to 200. However, the default limit of 50 assets per project is set in the .env file, and there is no need to modify the code to change this setting.

Useful resources
Hi,

I have deployed webstudio locally with VsCode (https://docs.webstudio.is/contributing/contributing-for-developers#running-the-webstudio-project-using-vs-code).

I seem to have reached the maximum asset limit (which I find quite low).

Error message:
Plain Text
The maximum number of assets per project is 50.


Is there a way to increase this limit?
M
O
6 comments
I have solved my issue by modifing this file /workspaces/webstudio/packages/asset-uploader/src/upload.ts

With:

Plain Text
  const MAX_ASSETS_PER_PROJECT = 200;
  const count = (uploadedCount.count ?? 0) + (uploadingCount.count ?? 0);

  if (count >= MAX_ASSETS_PER_PROJECT) {
    /**
     * Here is right to write `Max ${MAX_ASSETS_PER_PROJECT}` but see the comment below,
     * it's probable that the user can exceed the limit a little bit.
     * So it can be a little bit strange that the limit is 5 but the user already has 7.
     **/
    throw new Error(
      `The maximum number of assets per project is ${MAX_ASSETS_PER_PROJECT}.`
    );
  }


I don't know if it's the best practice but it works πŸ™‚
50 was never a default limit
ah its in the .env file by default
MAX_ASSETS_PER_PROJECT=50
no need to modify code for that, its an env setting
thanks πŸ‘Œ
Add a reply
Sign up and join the conversation on Discord