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

new FormData() raises TypeError in node #2289

Closed
6 tasks done
janosh opened this issue Nov 7, 2022 · 0 comments · Fixed by #2290
Closed
6 tasks done

new FormData() raises TypeError in node #2289

janosh opened this issue Nov 7, 2022 · 0 comments · Fixed by #2290

Comments

@janosh
Copy link
Contributor

janosh commented Nov 7, 2022

Describe the bug

FormData runs fine in Stackblitz but raises TypeError in node.

Related: #2276 (maybe a more minimal reproduction here)

Reproduction

Stackblitz

import { expect, test } from 'vitest';

test(`should create a coorect formdata`, () => {
  const form = document.createElement(`form`);
  document.body.appendChild(form);
  const formdata = new FormData(form);

  expect(formdata).toBeInstanceOf(FormData);
});
TypeError: FormData constructor: Argument 1 could not be converted to: null.

System Info

System:
    OS: macOS 13.0
    CPU: (10) arm64 Apple M1 Pro
    Memory: 100.34 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.9.0 - /opt/homebrew/bin/node
    npm: 8.19.1 - /opt/homebrew/bin/npm
  Browsers:
    Brave Browser: 107.1.45.118
    Chrome: 107.0.5304.87
    Safari: 16.1
  npmPackages:
    vite: ^3.1.8 => 3.1.8 
    vitest: ^0.24.3 => 0.24.3

Used Package Manager

pnpm

Validations

@sheremet-va sheremet-va added the bug label Nov 8, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants