{"record":{"id":"934a400019501dd4","repo":"Budibase/budibase","slug":"only-svelte-5-plugins-are-supported-on-this-branch","errorCode":null,"errorMessage":"Only Svelte 5 plugins are supported on this branch","messagePattern":"Only Svelte 5 plugins are supported on this branch","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/server/src/api/controllers/plugin/index.ts","lineNumber":124,"sourceCode":"      }\n      default:\n        ctx.throw(400, \"Invalid source\")\n    }\n\n    pluginCore.validate(metadata.schema)\n\n    // Only allow components in cloud\n    if (!env.SELF_HOSTED && metadata.schema?.type !== PluginType.COMPONENT) {\n      throw new Error(\n        \"Only component plugins are supported outside of self-host\"\n      )\n    }\n\n    if (\n      metadata.schema?.metadata?.svelteMajor !== 5 &&\n      metadata.schema?.type === PluginType.COMPONENT\n    ) {\n      throw new Error(\"Only Svelte 5 plugins are supported on this branch\")\n    }\n\n    let origin\n    if (source === PluginSource.GITHUB) {\n      const { repo, url: canonical } = sdk.plugins.parseGithubRepo(url)\n      if (repo && canonical) {\n        origin = { source: \"github\" as const, repo, url: canonical }\n      }\n    }\n\n    const doc = await pro.plugins.storePlugin(\n      metadata,\n      directory!,\n      source,\n      origin\n    )\n\n    clientAppSocket?.emit(\"plugins-update\", { name, hash: doc.hash })","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/server/src/api/controllers/plugin/index.ts#L106-L142","documentation":"This branch of Budibase only supports component plugins built for Svelte 5. Component plugins declaring svelteMajor other than 5 (or omitting it, defaulting to 4) in their schema.json metadata are rejected at install time.","triggerScenarios":"Installing a component plugin whose schema.json has metadata.svelteMajor set to 4 (or absent) while type is component.","commonSituations":"Using a legacy plugin written for Budibase's Svelte 4 era; plugin boilerplate not yet migrated; forgetting to bump svelteMajor in schema.json after porting the component code.","solutions":["Update the plugin to Svelte 5 and set metadata.svelteMajor: 5 in schema.json","Rebuild and republish the plugin tarball after migration","Use a Budibase release/branch that supports Svelte 4 plugins","Check the plugin repo for a Svelte 5 migration branch"],"exampleFix":"// schema.json\n// before\n\"metadata\": { \"type\": \"component\", \"version\": 1 }\n// after\n\"metadata\": { \"type\": \"component\", \"version\": 1, \"svelteMajor\": 5 }","handlingStrategy":"validation","validationCode":"const schema = JSON.parse(await fs.readFile('schema.json', 'utf8'))\nif (schema.type === 'component' && schema.metadata?.svelteMajor !== 5) {\n  throw new Error('Component plugin must declare svelteMajor: 5')\n}","typeGuard":"function isSvelte5Component(schema: { type?: string; metadata?: { svelteMajor?: number } }): boolean {\n  return schema.type === 'component' && schema.metadata?.svelteMajor === 5\n}","tryCatchPattern":"try {\n  await installPlugin({ source: 'NPM', url })\n} catch (err) {\n  if (err.message === 'Only Svelte 5 plugins are supported on this branch') {\n    console.error('Migrate the plugin to Svelte 5 and set svelteMajor: 5 in schema.json')\n  }\n}","preventionTips":["Add svelteMajor: 5 to schema.json metadata when building component plugins","Migrate legacy Svelte 4 components before installing on current branches","Rebuild and republish the tarball after migration","Pin to a Budibase release supporting Svelte 4 if migration is not possible yet"],"tags":["plugin","svelte","compatibility"],"backgroundTag":"plugin-svelte-version-unsupported","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}