Skip to content

Conversation

iaminawe
Copy link

I was getting an error where tools was undefined and the interface was not starting.

tools.map is not a function. (In 'tools.map((tab, index) => /*#__PURE__*/(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxDEV)(_components_button_Button__WEBPACK_IMPORTED_MODULE_6__.Button, {
label: tab.name,
iconPosition: 'start',
icon: renderIcon(tab.name),
buttonStyle: activeTab === index ? 'action' : 'regular',
onClick: () => setActiveTab(index)
}, index, false, {
fileName: _jsxFileName,
lineNumber: 791,
columnNumber: 15
}, this))', 'tools.map' is undefined)

The errors seem to be related to the fetchTools function not being properly defined within the useEffect hook.

  • I moved the fetchTools function inside the useEffect hook to ensure proper scoping.
  • Fixed references to client, wavStreamPlayer, sessionID that are now out of scope.
  • Ensured the fetchTools function is being called within the useEffect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant