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

formData.keys, .entries is not a function #91

Closed
tranzium opened this issue Nov 11, 2021 · 3 comments
Closed

formData.keys, .entries is not a function #91

tranzium opened this issue Nov 11, 2021 · 3 comments
Labels
dependency Issue in dependency fixed-in-next Fixed in next release

Comments

@tranzium
Copy link

tranzium commented Nov 11, 2021

When using request.formData() and obtaining a FormData object, both the "entries" and "keys" methods are not found.

miniflare --version // 2.0.0-next.3

const form = await request.formData()
if ("entries" in form) {
  console.log("entries", ...form.entries())
}
if ("keys" in form) {
  console.log("keys", ...form.keys())
}

miniflare --debug

(no output)
POST /login/ 200 OK (174.75ms)

wrangler dev

entries [ 'email',  '' ] [ 'passphrase',  '' ]
keys email passphrase

entries [ 'email',  '' ] [ 'passphrase',  '' ] [ 'remember',  '' ] [ 'username',  '' ] [ 'uuid',  '' ]
keys email passphrase remember username uuid
POST project.username.workers.dev/login/ HTTP/1.1 200 OK
@mrbbot
Copy link
Contributor

mrbbot commented Nov 11, 2021

Hey! 👋 This looks like an error in undici, the package Miniflare uses to provide fetch, Response, FormData, etc. I'd suggest you open an issue there. 🙂

import { FromData } from "undici";
const formData = new FormData();
formData.append("key", "value");
console.log("entries" in formData); // false
console.log("keys" in formData); // false

@tranzium
Copy link
Author

Updating dependency undici to v4.10.0 will correct this issue.

mrbbot added a commit that referenced this issue Nov 20, 2021
@mrbbot mrbbot added the fixed-in-next Fixed in next release label Nov 20, 2021
@mrbbot
Copy link
Contributor

mrbbot commented Nov 22, 2021

Hey! 👋 miniflare@2.0.0-rc.2 has just been released, including the fix for this. You can find the changelog here.

@mrbbot mrbbot closed this as completed Nov 22, 2021
mrbbot added a commit that referenced this issue Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency Issue in dependency fixed-in-next Fixed in next release
Projects
None yet
Development

No branches or pull requests

2 participants