{"record":{"id":"cfa295dfe97aab23","repo":"mdx-js/mdx","slug":"expected-jsxs-given-to-evaluate","errorCode":null,"errorMessage":"Expected `jsxs` given to `evaluate`","messagePattern":"Expected `jsxs` given to `evaluate`","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/mdx/lib/util/resolve-evaluate-options.js","lineNumber":75,"sourceCode":" */\nexport function resolveEvaluateOptions(options) {\n  const {\n    Fragment,\n    baseUrl,\n    development,\n    jsx,\n    jsxDEV,\n    jsxs,\n    useMDXComponents,\n    ...rest\n  } = options || {}\n\n  if (!Fragment) throw new Error('Expected `Fragment` given to `evaluate`')\n  if (development) {\n    if (!jsxDEV) throw new Error('Expected `jsxDEV` given to `evaluate`')\n  } else {\n    if (!jsx) throw new Error('Expected `jsx` given to `evaluate`')\n    if (!jsxs) throw new Error('Expected `jsxs` given to `evaluate`')\n  }\n\n  return {\n    compiletime: {\n      ...rest,\n      development,\n      outputFormat: 'function-body',\n      providerImportSource: useMDXComponents ? '#' : undefined\n    },\n    runtime: {Fragment, baseUrl, jsx, jsxDEV, jsxs, useMDXComponents}\n  }\n}\n","sourceCodeStart":57,"sourceCodeEnd":88,"githubUrl":"https://github.com/mdx-js/mdx/blob/685627a819567c0788eadb85f5f57065bcc81c2c/packages/mdx/lib/util/resolve-evaluate-options.js#L57-L88","documentation":"In production mode the compiled MDX code calls `jsxs` for elements with multiple children (static children optimization). resolveEvaluateOptions therefore requires `jsxs` whenever `development` is falsy, and throws this error if it is absent, because the generated program would otherwise crash at runtime.","triggerScenarios":"Calling `evaluate(code, { Fragment, jsx })` without `jsxs`; passing a minimal runtime object missing the `jsxs` export; Vue/Solid adapters where the multi-child factory has a different name and wasn't mapped to `jsxs`.","commonSituations":"Hand-assembled evaluate options; bundler tree-shaking removing `jsxs`; copying dev-mode config (`jsxDEV` only) into a production path.","solutions":["Add `jsxs` from 'react/jsx-runtime' (or equivalent) to the evaluate options.","Import the full set `Fragment, jsx, jsxs` as one unit to avoid partial runtimes.","If you intended development mode, set `development: true` and pass `jsxDEV` instead."],"exampleFix":"// before\nawait evaluate(code, { Fragment, jsx })\n// after\nimport { Fragment, jsx, jsxs } from 'react/jsx-runtime'\nawait evaluate(code, { Fragment, jsx, jsxs })","handlingStrategy":"validation","validationCode":"if (!development && !runtime.jsxs) {\n  throw new Error('evaluate options require `jsxs` when development is falsy')\n}","typeGuard":"function hasJsxs(rt) {\n  return typeof rt === 'object' && rt !== null && typeof rt.jsxs === 'function'\n}","tryCatchPattern":"try {\n  const result = await evaluate(code, runtime)\n} catch (err) {\n  if (err.message === 'Expected `jsxs` given to `evaluate`') {\n    console.error('Provide jsxs from your jsx-runtime in evaluate options')\n  } else throw err\n}","preventionTips":["Import the full `{ Fragment, jsx, jsxs }` set as one statement so bundlers/tree-shaking can't drop parts.","Map non-React libraries' multi-child factories to `jsxs` explicitly in your adapter.","Smoke-test evaluation of MDX containing multi-element JSX in CI."],"tags":["mdx","evaluate","configuration"],"backgroundTag":"missing-required-option","analyzedSha":"685627a819567c0788eadb85f5f57065bcc81c2c","analyzedAt":"2026-09-02T16:11:18.599Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}