{"record":{"id":"f79c515a652e6227","repo":"handsontable/handsontable","slug":"the-data-setting-is-ignored-when-hasexternaldat","errorCode":null,"errorMessage":"The \"data\" setting is ignored when \"hasExternalDataSource\" returns `true`.","messagePattern":"The \"data\" setting is ignored when \"hasExternalDataSource\" returns `true`\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"handsontable/src/core.ts","lineNumber":3625,"sourceCode":"\n            themeObject = registerTheme(settings.theme);\n          } else {\n            themeObject = settings.theme as ThemeBuilder;\n          }\n\n          instance.themeManager!.update(themeObject);\n          instance.useTheme(instance.themeManager!.getClassName());\n        }\n      }\n    }\n\n    const themeOverridesChanged = applyThemeOverrides(settings, init);\n\n    // Load data or create data map\n    if (instance.runHooks('hasExternalDataSource') === true) {\n      // When dataProvider is a complete server-backed config, ignore static data, the plugin loads rows.\n      if (settings.data) {\n        warn('The \"data\" setting is ignored when \"hasExternalDataSource\" returns `true`.');\n      }\n\n      // Replace the in-memory placeholder only when the update touches init, `data`, or `dataProvider`. Otherwise\n      // `updateData([], …)` would empty the grid without a refetch, because DataProvider runs `updatePlugin` only when\n      // `dataProvider` is present in this payload.\n      const shouldSyncExternalPlaceholderData = init ||\n        hasOwnProperty(settings, 'data') ||\n        hasOwnProperty(settings, 'dataProvider');\n\n      if (shouldSyncExternalPlaceholderData) {\n        dataUpdateFunction([], 'updateSettings');\n      } else if (settings.columns !== undefined) {\n        datamap.createMap();\n        instance.initIndexMappers();\n      }\n\n    } else if (settings.data === undefined && tableMeta.data === undefined) {\n      dataUpdateFunction(null as unknown as unknown[], 'updateSettings'); // data source created just now","sourceCodeStart":3607,"sourceCodeEnd":3643,"githubUrl":"https://github.com/handsontable/handsontable/blob/2c365a3291b45a331a6de1ed10a9deba683cfbc3/handsontable/src/core.ts#L3607-L3643","documentation":"When a hook/callback named hasExternalDataSource returns true, Handsontable treats data loading as delegated to an external data provider (server-backed), so any static data setting in the same payload cannot be used — it is ignored and this warning tells you why your data array never reached the grid.","triggerScenarios":"Registering a hasExternalDataSource hook returning true (or a DataProvider config that implies it) while also passing data: [...] in init or updateSettings/updateData.","commonSituations":"Switching a grid from static data to a server-backed data provider but leaving the old data array in the settings object; wrapper components that always pass a data prop while a parent wires up external data loading.","solutions":["Remove the data setting from init/updateSettings/updateData when the external data source is active","Or return false from (or remove) the hasExternalDataSource hook if you actually want static data","Keep the static data path and the provider path mutually exclusive in your component logic"],"exampleFix":"// before\nhot.updateSettings({ data: localRows }); // hook returns true, so ignored\n\n// after\nhot.updateData([], { dataProvider }); // or return false from hasExternalDataSource and pass data normally","handlingStrategy":"validation","validationCode":"const external = hot.runHooks('hasExternalDataSource') === true;\nif (external && settings.data) {\n  delete settings.data; // would be ignored anyway\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make data and hasExternalDataSource mutually exclusive in your grid factory","When introducing a data provider, remove the static data prop in the same change","Log a dev-time assertion when both are present in a settings payload"],"tags":["data-loading","configuration","ignored-option","external-data-source"],"backgroundTag":"conflicting-data-sources","analyzedSha":"2c365a3291b45a331a6de1ed10a9deba683cfbc3","analyzedAt":"2026-09-01T10:26:16.720Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}