Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare Workers : crossFetch2.fetch is not a function #215

Open
arkhaiel opened this issue Sep 15, 2024 · 1 comment
Open

Cloudflare Workers : crossFetch2.fetch is not a function #215

arkhaiel opened this issue Sep 15, 2024 · 1 comment

Comments

@arkhaiel
Copy link

Hello there,

I'm trying to create a small caldav client on my web app using Nuxt/Nuxt Hub which is using cloudflare workers.
Everything works fine on my local dev server, but when I try to make it work after deploying on cloudflare workers, I have this error, and I'm stuck.

I'm quite new with cloudflare workers and I don't really know how to make it work. Just spent 5 hours trying many things, but I'm not able to get something working.

Any idea ?

Thanks !

My API route is quite simple :

import { createDAVClient } from 'tsdav'

export default defineEventHandler(async (event) => {
  const { appleId, appleOtp } = useRuntimeConfig(event)

  const client = await createDAVClient({
    serverUrl: 'https://caldav.icloud.com',
    credentials: {
        username: appleId,
        password: appleOtp,
    },
    authMethod: 'Basic',
    defaultAccountType: 'caldav',
  })

  const cals = await client.fetchCalendars();
  

  return cals
})

@natelindev
Copy link
Owner

will add support in the future.

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

No branches or pull requests

2 participants