-
Notifications
You must be signed in to change notification settings - Fork 295
Installing WooCommerce as a plugin leads to empty body #96
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
Comments
My hypothesis is that Woo relies on an API request while WordPress Playground doesn't support networking yet. There could be other reasons, too – the |
But isn't it kind of strange that the whole HTML output is logged to the console? Seems like there is some content available to be delivered but that seems to fail. I've already checked the |
It is kind of strange! Perhaps there's another explanation then.
This would mean something is off with wordpress-playground/src/php-wasm/wasm/build-assets/php_wasm.c Lines 88 to 105 in 24c400e
|
Hi there, I did some further debugging. The issue seems to be related to using custom output buffering. Woo uses The same is happening for the checkout here. I've patched the files (removed the
|
Great find @dennisnissle! This PHP function must be somehow flushing the buffer to stdout despite the redirect set up in php_wasm.c: As for the |
Perhaps the buffer gets flushed in |
That was it – I pushed a fix in 9d3ad83: I'll deploy the fix to wasm.wordpress.net in a week-two, for now a commit must do. Thanks for the report! |
Fix deployed: http://127.0.0.1:8777/wordpress.html?plugin=woocommerce&url=/wp-admin/ If it loads a blank page, click the address bar and press enter to reload. Static assets sometimes error out with 403 – that's a separate issue somehow related to service workers. It mostly happens when devtools are open. |
Here's another related issue that will have to be solved to make the WooCommerce installation wizard work: #103 |
That issue was solved by #107. I got to Woo dashboard in wp-admin! Network access aside, there's also some problem with creating one of the woocommerce database tables, presumably due to syntax differences between mysql and sqlite. |
## Motivation for the change, related issues Playground currently uses JSDOM as the environment when running tests with Vite, this PR changes the Vite test environment to Node. JSDOM creates an environment that overrides some existing Node.js globals with its polyfills. For example of the globals it replaces is URL and it replaces it with `whatwg-url`. As a result, when we run tests with JSDOM they might fail because the JSDOM environment isn't fully compatible with Node. Because Playground packages (except for web-specific packages like remove and website) should be Node compatible, we need to use Node as the environment for running tests. ## Implementation details The PR updates the Vite test environments to Node, including the web-specific packages like remove and website which don't have any tests at the moment. It also removes JSDOM polyfills and ensures the `PHPRequestHandler` always has an absolute path. The path isn't required, but without it, before this change requests would fail because they would use an incorrect path. I considered leaving JSDOM for the web-specific packages, but [from my research in this thread](https://github.com/Automattic/wordpress-playground-private/pull/89/files/7a0eb0d405c4a7c0a641db8470187e124d9894b1..a464c0e4a843b47f61e74cf73591c4ac4504d44e#r2010964064) I don't think that JSDOM is the best environment for running tests because it creates a custom environment instead of mocking the Dom environment. ## Testing Instructions (or ideally a Blueprint) - CI
Hi there,
did anyone try to install WooCommerce as a plugin? Seems to break something in WP-Admin (maybe the HTML structure) which leads to returning an empty body for the php response. The HTML gets outputted just fine to the console though.
To reproduce:
Any help/debugging advice is appreciated.
Best,
Dennis
The text was updated successfully, but these errors were encountered: