-
Notifications
You must be signed in to change notification settings - Fork 374
Closed
Description
The problem
I received the following error when attempting to use the installPlugin function.
Uncaught (in promise) TypeError: Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.
Some troubleshooting
The error originated from line 16:
| const pluginFormPage = asDOM(pluginForm); | |
| const pluginFormData = new FormData( | |
| pluginFormPage.querySelector('.wp-upload-form')! as HTMLFormElement | |
| ) as any; |
I checked the selectors, and they look right. Perhaps it is something wrong with the request in the following? I double checked the url and it works in a regular WordPress instance. But I am unfamiliar with how to debug a request through the ServiceWorker.
| const pluginForm = await playground.request({ | |
| relativeUrl: '/wp-admin/plugin-install.php?tab=upload', | |
| }); |
Additional information
This is the project in which I am getting the error. It's pretty simple, I'm just trying to figure out a bare minimum implementation of this to showcase a plugin in development.
The current version of the site is hosted here if you want to examine the issue in the wild.
Metadata
Metadata
Assignees
Labels
No labels