weaviate / typescript-client

Official Weaviate TypeScript Client
https://www.npmjs.com/package/weaviate-ts-client
BSD 3-Clause "New" or "Revised" License
57 stars 21 forks source link

ReferenceError: fetch is not defined #146

Closed pribadihcr closed 4 weeks ago

pribadihcr commented 4 weeks ago

Hi, I tried this repo: https://github.com/weaviate-tutorials/next-multimodal-search-demo

when I run yarn run import, I got the following error:

ReferenceError: fetch is not defined ... Node.js v17.0.0 error Command failed with exit code 1.

tsmith023 commented 4 weeks ago

Hi @pribadihcr, the v2 TS client was refactored in a breaking way to remove the isomorphic-fetch dependency replacing it with the native fetch API. In order to use fetch with node<18 you need to install it with the --experimental-fetch flag set otherwise fetch won't be available to the client. Alternatively, you can use node>=18 and it will work fine!