{"record":{"id":"6c7aa945735f3817","repo":"Budibase/budibase","slug":"features-do-not-exist-for-plantype-plantype","errorCode":null,"errorMessage":"Features do not exist for planType=${planType}","messagePattern":"Features do not exist for planType=(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/pro/src/sdk/licensing/licenses/features.ts","lineNumber":150,"sourceCode":"    Feature.AI_CUSTOM_CONFIGS,\n    Feature.PWA,\n    Feature.CUSTOM_APP_SCRIPTS,\n    Feature.PDF,\n    Feature.BUDIBASE_AI,\n    Feature.RECAPTCHA,\n    Feature.PKCE_OIDC,\n    Feature.TRANSLATIONS,\n    Feature.MICROFRONTEND,\n  ],\n}\n\nexport function getOfflineFeatures(planType: PlanType): Feature[] {\n  function readFeatures(planFeatures: PlanFeatures): Feature[] {\n    const quotas = planFeatures[planType]\n\n    if (!quotas) {\n      // e.g. Premium plan doesn't exist on self host\n      throw new Error(`Features do not exist for planType=${planType}`)\n    }\n\n    return quotas\n  }\n  return readFeatures(SELF_FEATURES)\n}\n","sourceCodeStart":132,"sourceCodeEnd":157,"githubUrl":"https://github.com/Budibase/budibase/blob/a81a902e9a8fe55b467d106765f6638f12e35c49/packages/pro/src/sdk/licensing/licenses/features.ts#L132-L157","documentation":"getOfflineFeatures looks up the plan's features in the hard-coded SELF_FEATURES table for self-hosted offline licenses. If the license's plan.type has no entry there (e.g. a cloud-only plan like Premium used on self host), this plain Error is thrown. It means the offline license references a plan that self host does not support.","triggerScenarios":"Calling getOfflineFeatures(planType) (indirectly via enrichLicense → getOfflineLicense after verifyOfflineLicenseToken succeeds) with a PlanType that has no key in SELF_FEATURES.","commonSituations":"Applying an offline license token generated for a cloud plan (e.g. Premium/enterprise cloud-only tier) to a self-hosted installation; a PlanType added in a newer Budibase version but the running version's SELF_FEATURES map predates it (or vice versa — token from newer version, older runtime); hand-edited license tokens.","solutions":["Use an offline license token whose plan type is valid for self host (e.g. the self-host tier for your subscription), not a cloud-only plan.","Regenerate the offline token from the account portal for the correct plan/hosting combination.","Upgrade Budibase/pro so the runtime's SELF_FEATURES map includes the plan type in the token.","Check the planType value in the decoded license token to confirm which plan it grants."],"exampleFix":"// before\nconst features = getOfflineFeatures(license.plan.type) // throws for Premium\n// after\nconst SELF_PLAN_TYPES = Object.keys(SELF_FEATURES) as PlanType[]\nif (!SELF_PLAN_TYPES.includes(license.plan.type)) {\n  console.warn(`Plan ${license.plan.type} unsupported on self host — skipping offline features`)\n} else {\n  const features = getOfflineFeatures(license.plan.type)\n}","handlingStrategy":"validation","validationCode":"import { SELF_FEATURES } from \"../licensing/licenses/features\"\nfunction planSupportedOnSelfHost(planType: PlanType): boolean {\n  return Boolean(SELF_FEATURES[planType])\n}\nif (!planSupportedOnSelfHost(license.plan.type)) {\n  throw new Error(`Plan ${license.plan.type} is not available on self host`)\n}","typeGuard":"function hasSelfHostFeatures(planType: PlanType): planType is keyof typeof SELF_FEATURES {\n  return Boolean(SELF_FEATURES[planType])\n}","tryCatchPattern":"try {\n  const license = await getOfflineLicense()\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith(\"Features do not exist for planType=\")) {\n    // offline token uses a cloud-only plan — request a self-host token\n  } else throw e\n}","preventionTips":["Only issue offline tokens for plans that exist on self host.","Match Budibase/pro versions between token generation and consumption.","Decode tokens and check plan.type before offline activation."],"tags":["licensing","offline-license","plan-type","features"],"backgroundTag":"unsupported-plan-type","analyzedSha":"a81a902e9a8fe55b467d106765f6638f12e35c49","analyzedAt":"2026-08-29T01:03:10.972Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}