{"record":{"id":"ca8f5f8bb4b357d2","repo":"krisk/Fuse","slug":"object-query-syntax-is-not-available-in-this-build","errorCode":null,"errorMessage":"Object query syntax is not available in this build","messagePattern":"Object query syntax is not available in this build","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/queryParser.ts","lineNumber":118,"sourceCode":"        return obj\n      }\n\n      // Object (\"MongoDB-style\") operator leaf. Retain the raw operator object\n      // so the AST identifies the query even when searcher-free; build the\n      // searcher only when `auto` (mirrors the string leaf's gating). The\n      // compiler lives behind the extended-search flag: if it isn't registered\n      // (dev `Fuse.parseQuery` on a minimal build), throw a clear error rather\n      // than silently misbehave.\n      if (isObjectLike(value) && !isArray(value)) {\n        const obj: ParsedLeaf = {\n          keyId: createKeyId(key),\n          fieldQuery: value\n        }\n\n        if (auto) {\n          const compile = getObjectCompiler()\n          if (!compile) {\n            throw new Error(ErrorMsg.OBJECT_QUERY_UNAVAILABLE)\n          }\n          const keyPath = isArray(key) ? key.join('.') : String(key)\n          obj.searcher = compile(value, keyPath, options)\n        }\n\n        return obj\n      }\n\n      throw new Error(ErrorMsg.LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))\n    }\n\n    const node: ParsedOperator = {\n      children: [],\n      operator: keys[0]\n    }\n\n    keys.forEach((key) => {\n      const value = query[key]","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/krisk/Fuse/blob/edf2fb608eca0461508d1d71317e6e58309ffada/src/core/queryParser.ts#L100-L136","documentation":"Object (field) query syntax like { title: { $contains: 'x' } } requires the extended-search object compiler, which is optional in some builds. When the query parser auto-detects an object query and getObjectCompiler() returns nothing (feature not bundled or not registered), it throws this error rather than failing later with an opaque message.","triggerScenarios":"Passing a query object with per-field operator values to fuse.search() in a build where the object-query compiler is unavailable (e.g. the basic/minimal entry point, or extended search not enabled).","commonSituations":"Using the basic Fuse build with extended-search syntax; switching from the full bundle to a tree-shaken/lite entry; copying extended-search examples into an app importing a minimal build.","solutions":["Import the full fuse.js entry point (which includes extended search) instead of a basic/minimal one.","Enable extended search support (EXTENDED_SEARCH_ENABLED) so the compiler is registered.","Rewrite the query as a plain string or logical expression supported by the current build."],"exampleFix":"// before (basic build)\nimport Fuse from 'fuse.js/basic'\nfuse.search({ title: { $contains: 'world' } })\n// after\nimport Fuse from 'fuse.js'\nprocess.env.EXTENDED_SEARCH_ENABLED = '1'\nfuse.search({ title: { $contains: 'world' } })","handlingStrategy":"fallback","validationCode":"const usesObjectQuery = (q) =>\n  q !== null && typeof q === 'object' &&\n  Object.values(q).some(v => v !== null && typeof v === 'object')\nif (usesObjectQuery(query) && !extendedSearchAvailable()) {\n  query = toPlainStringQuery(query) // degrade before calling search\n}\nfuse.search(query)","typeGuard":"const hasObjectCompiler = () => typeof getObjectCompiler() === 'function'","tryCatchPattern":"try {\n  return fuse.search(query)\n} catch (e) {\n  if (e.message.includes('Object query syntax is not available')) {\n    return fuse.search(toPlainStringQuery(query))\n  }\n  throw e\n}","preventionTips":["Import the full fuse.js entry when using extended/object queries.","Verify the compiler survives tree-shaking in your build.","Keep query builders aligned with the imported build's features."],"tags":["build-configuration","extended-search","query-parser"],"backgroundTag":"feature-not-available-in-build","analyzedSha":"edf2fb608eca0461508d1d71317e6e58309ffada","analyzedAt":"2026-09-02T02:46:54.623Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}