Skip to content

Typeform API client not compatible with Cloudflare workers / Vercel edge runtime #94

Open
@magnuslundin

Description

@magnuslundin

The current version of the Typeform API client does not run well on a Cloudflare worker / Vercel edge runtime. Creating a client result in the following error:

ReferenceError: window is not defined
    at (../../../../node_modules/.pnpm/@typeform+api-client@1.8.0/node_modules/@typeform/api-client/dist/typeform-api.js:1:209)
    at (../../../../node_modules/.pnpm/@typeform+api-client@1.8.0/node_modules/@typeform/api-client/dist/typeform-api.js:1:68)
    at (../../../../node_modules/.pnpm/@typeform+api-client@1.8.0/node_modules/@typeform/api-client/dist/typeform-api.js:1:170)
...

This is most probably caused by the (3 year old..) dependency to Axios. A switch to fetch should not only resolve the compatibility issue, but render the project free from build dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions