Skip to content
This repository was archived by the owner on Jun 6, 2024. It is now read-only.
This repository was archived by the owner on Jun 6, 2024. It is now read-only.

FormData doesn't exist #153

@maple3142

Description

@maple3142
addEventListener('fetch', event => {
  event.respondWith(handleRequest(event.request))
})

/**
 * Respond to the request
 * @param {Request} request
 */
async function handleRequest(request) {
  const fd = new FormData()
  return new Response('hello world', {status: 200})
}

This script runs in CloudFlare workers normally, but not in CloudWorker.

But it can be solved by using bindings:

{
	bindings: {
		FormData: require('form-data')
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions