kwhitley / itty-fetcher

An even simpler wrapper around native Fetch to strip boilerplate from your fetching code!
MIT License
99 stars 4 forks source link

TypeError: Cannot read properties of null (reading 'includes') #32

Closed kalepail closed 1 year ago

kalepail commented 1 year ago

Looks like not every response has a content-type https://github.com/kwhitley/itty-fetcher/blob/v0.x/src/itty-fetcher.ts#L130

TypeError: Cannot read properties of null (reading 'includes')
    at /Users/tylervanderhoeven/Desktop/Web/XLMBQ/xlm-bible-quizzing-wrangler/dist/node_modules/.pnpm/itty-fetcher@0.8.1/node_modules/itty-fetcher/dist/itty-fetcher.mjs:1:865
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at sendCode (/Users/tylervanderhoeven/Desktop/Web/XLMBQ/xlm-bible-quizzing-wrangler/dist/src/utils/email.ts:13:3)
    at Object.handle (/Users/tylervanderhoeven/Desktop/Web/XLMBQ/xlm-bible-quizzing-wrangler/dist/node_modules/.pnpm/itty-router@4.0.0-next.46/node_modules/itty-router/index.js:1:580)
    at ServiceWorkerGlobalScope.[kDispatchFetch] (/opt/homebrew/lib/node_modules/miniflare/node_modules/@miniflare/core/src/standards/event.ts:385:13)
    at Server.<anonymous> (/opt/homebrew/lib/node_modules/miniflare/node_modules/@miniflare/http-server/src/index.ts:291:20)
kalepail commented 1 year ago

https://github.com/kwhitley/itty-fetcher/pull/33 Maybe helpful?

kwhitley commented 1 year ago

Sorted via #33 :)