webflow / js-webflow-api

Node.js SDK for the Webflow Data API
https://www.npmjs.com/package/webflow-api
296 stars 95 forks source link

TypeError: res.data.map is not a function #117

Closed ianzone closed 6 months ago

ianzone commented 7 months ago
node_modules\.pnpm\webflow-api@1.3.1\node_modules\webflow-api\dist\core\webflow.js:242
        return res.data.map((data) => new api_1.Site(this.client, { ...res, data }));
                        ^
TypeError: res.data.map is not a function
    at Webflow.sites (C:\Users\yihen\Projects\test\webflow\node_modules\.pnpm\webflow-api@1.3.1\node_modules\webflow-api\dist\core\webflow.js:242:25)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async FnName (C:\Users\yihen\Projects\test\webflow\client.ts:11:16)
dsinghvi commented 7 months ago

@ianzone what runtime or version of Node are you running on? What endpoint were you calling that caused this error?

dsinghvi commented 6 months ago

Looks like you are using the v1 SDK, if you try upgrading to v2 this issue should be fixed!