Skip to content

Conversation

bcotrim
Copy link
Contributor

@bcotrim bcotrim commented Sep 18, 2025

Related issues

Proposed Changes

  • Migrate from Webpack to Vite for running Studio locally and building

Testing Instructions

  • npm install
  • npm start
  • npm run make
  • Run Studio smoke tests locally
  • Download artifacts from CI for macOS and Windows and test Studio

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@bcotrim bcotrim mentioned this pull request Sep 18, 2025
1 task
@bcotrim bcotrim self-assigned this Sep 18, 2025
@bcotrim bcotrim requested a review from a team September 19, 2025 17:06
@bcotrim bcotrim marked this pull request as ready for review September 19, 2025 17:09
Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @bcotrim for doing this massive change! I have tested on Windows and most of the features work, but I have found an issue creating sites using blueprints.

First, let me describe the tests on Windows:

npm install
npm start
✅ Adding a site
✅ Logging in to WordPress.com
✅ Connect a WordPress.com site
✅ Creating preview sites
✅ Using the AI assistant

But when creating a site using Blueprints, I get the following (I think is a known error):

Permissions requested to delete the folder Error
CleanShot 2025-09-22 at 13 16 44@2x CleanShot 2025-09-22 at 13 25 16@2x

The following is the error trace:

[2025-09-22T11:24:51.737Z][erro][main] Failed to setup WordPress site: Error: Could not start server: Error: Error when executing the blueprint step #2 ({"step":"installPlugin","pluginData":{"resource":"wordpress.org/plugins","slug":"akismet"},"options":{"activate":true}}) : Could not create directory "/wordpress/wp-content/AD/[j*)YTGBA^-&yrk#S9[+)jyyN+f(1[xl": Invalid argument.
    at C:\Users\robertoaranda\github\studio\dist\main\index.js:12938:28
    at ForkUtilityProcess.<anonymous> (C:\Users\robertoaranda\github\studio\node_modules\@sentry\electron\main\utility-processes.js:67:40)
    at ForkUtilityProcess.emit (node:events:530:35)
    at ForkUtilityProcess.a.emit (node:electron/js2c/browser_init:2:73957)
[2025-09-22T11:25:06.415Z][erro][main] Error occurred in handler for 'createSite': Error: Failed to perform delete operation
[2025-09-22T11:25:06.418Z][erro][ren1] Failed to create site

I have the error using the development version executed with npm start, and with the artifact generated by the CI build for Windows

Copy link
Contributor

@gcsecsey gcsecsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making these chages @bcotrim. I tested the changes on Mac:

  • npm install
  • npm start
  • npm run make
  • npm test

The builds are also significantly faster than using webpack. 🎉

In both the dev build or when using the packaged build, I can

  • Start Studio
  • Create a new site using either the Quickstart/Developer Blueprints
  • Delete a site
  • Log in/log out of WP.com
  • Create preview sites

I encountered an issue when trying to create a site using the Commerce Blueprint, I consistently see this error, and I didn't encounter the same on trunk:

[playground-cli] Running the Blueprint...
Activating woocommerce-services – 85%Failed to setup WordPress site: Error: Timeout waiting for response to message 0
    at Timeout._onTimeout (/Users/gcsecsey/a8c-projects/studio/dist/main/index.js:13010:18)
    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7)
Error occurred in handler for 'createSite': Error: Timeout waiting for response to message 0
    at Timeout._onTimeout (/Users/gcsecsey/a8c-projects/studio/dist/main/index.js:13010:18)
    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7)
[playground-cli] Error: ENOENT: no such file or directory, lstat '/Users/gcsecsey/Studio/my-fresh-website'
    at lstatSync (node:fs:1716:25)
    at t.lstatSync (node:electron/js2c/node_init:2:4546)
    at /Users/gcsecsey/a8c-projects/studio/node_modules/@php-wasm/node/index.cjs:446680:46
    at PHP.mount (/Users/gcsecsey/a8c-projects/studio/node_modules/@php-wasm/universal/index.cjs:57:3839)
    at Object.m [as mountResources] (/Users/gcsecsey/a8c-projects/studio/node_modules/@wp-playground/cli/mounts-BJFrPHGW.cjs:4:553)
    at async Object.onPHPInstanceCreated (/Users/gcsecsey/a8c-projects/studio/node_modules/@wp-playground/cli/worker-thread-v1.cjs:2:236)
    at async n (/Users/gcsecsey/a8c-projects/studio/node_modules/@wp-playground/wordpress/index.cjs:355:2274)
    at async PHPProcessManager.phpFactory (/Users/gcsecsey/a8c-projects/studio/node_modules/@php-wasm/universal/index.cjs:89:3705)
    at async PHPProcessManager.doSpawn (/Users/gcsecsey/a8c-projects/studio/node_modules/@php-wasm/universal/index.cjs:83:3025) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/Users/gcsecsey/Studio/my-fresh-website'
}
[playground-cli] Worker 0 exited with code 1

I'm not sure if this might be related to STU-804.

@epeicher
Copy link
Contributor

Additional testing on Windows, when trying to Pull a site from WordPress.com I get the always a Timeout error:

Error with Pull After completion
CleanShot 2025-09-22 at 15 50 57@2x CleanShot 2025-09-22 at 15 53 51@2x

With the following error in the logs:

[2025-09-22T13:50:39.253Z][erro][main] Error occurred in handler for 'startServer': Error: Timeout waiting for response to message 0
    at Timeout._onTimeout (C:\Users\roberto\github\studio\dist\main\index.js:13014:18)
    at listOnTimeout (node:internal/timers:594:17)
    at process.processTimers (node:internal/timers:529:7)

The same site can be connected and Pulled on Mac, so this seems to be related to Windows

Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bcotrim, Great work migrating from webpack to Vite ! 🥳
I tested it on Mac using the built app in Buildkite and I confirm the main blockers are solved.

  • I was able to create a site using the wp-cli blueprint that downloads an image
  • I was able to see the plugins from .org and install a plugin
  • I also tested creating a preview site, pulling a wpcom site, talking to the assistant and running wp-cli command from the assistant, and everything worked as expected.

I just noticed two minor things:

  1. Some RTL styles are gone, for example the What's new modal.
  2. The Studio CLI returns a warning/error message [0922/160239.105499:ERROR:node_main.cc(142)] Node.js environment variables are disabled because this process is invoked by other apps.
  3. The thumbnail images on the blueprint screen blink when you select a file. (I'm not sure if this is related to this PR, but it's the first time I've noticed it.)
blueprint-thumbnails-reloading-when-selecting-or-removing-blueprint-file.mp4
Screenshot 2025-09-22 at 16 02 11

Although it seems the ENV variables work as expected:

Screenshot 2025-09-22 at 16 07 52

Comment on lines -37 to -45
<DynamicStylesheet
id="wordpress-components-style"
href={
i18n?.isRTL()
? '../main_window/styles/wordpress-components-style-rtl.css'
: '../main_window/styles/wordpress-components-style.css'
}
/>
<DynamicStylesheet id="main-window-style" href={ '../main_window.css' } />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to be able to load the RTL dynamically. Without this rtl.css, some components are a bit mixed up. For example, the "What's New" modal:

Screenshot 2025-09-22 at 15 54 51

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could replicate that issue in trunk and added a attempted fix: #1805

Copy link
Member

@sejas sejas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am approving it as I think my findings can be addressed as follow-ups.

@bcotrim
Copy link
Contributor Author

bcotrim commented Sep 22, 2025

I encountered an issue when trying to create a site using the Commerce Blueprint, I consistently see this error, and I didn't encounter the same on trunk:

@gcsecsey could you test again please? I pushed some changes from trunk and I could not replicate the issue. Can you confirm it was fixed?

The thumbnail images on the blueprint screen blink when you select a file. (I'm not sure if this is related to this PR, but it's the first time I've noticed it.)

@sejas regarding the images blinking I think it's unrelated to this change, and added another PR with a tentative fix: #1806 as I couldn't replicate it locally.

The Studio CLI returns a warning/error message [0922/160239.105499:ERROR:node_main.cc(142)] Node.js environment variables are disabled because this process is invoked by other apps.

I am not able to replicate this cli issue, can you give me a step by step? @epeicher @gcsecsey can you try to it on your end to confirm, please?

I am approving it as I think my findings can be addressed as follow-ups.

@epeicher @gcsecsey @sejas would you all agree to take this approach? That way we can split different issues and avoid me being the blocker.

@epeicher
Copy link
Contributor

epeicher commented Sep 23, 2025

I have done some additional testing. These are my findings:

I encountered an issue when trying to create a site using the Commerce Blueprint, I consistently see this error, and I didn't encounter the same on trunk:

I have been able to successfully create a site using Commerce Blueprint so it seems this issue is fixed

The Studio CLI returns a warning/error message [0922/160239.105499:ERROR:node_main.cc(142)] Node.js environment variables are disabled because this process is invoked by other apps.

I have tested the CLI to create and list preview sites and I have not found this error

I am approving it as I think my findings can be addressed as follow-ups.

@epeicher @gcsecsey @sejas would you all agree to take this approach? That way we can split different issues and avoid me being the blocker.

I agree with this approach. I think the issues found can be addressed as follow-ups and deploy these changes

@sejas
Copy link
Member

sejas commented Sep 23, 2025

The Studio CLI returns a warning/error message [0922/160239.105499:ERROR:node_main.cc(142)] Node.js environment variables are disabled because this process is invoked by other apps.

I am not able to replicate this cli issue, can you give me a step by step? @epeicher @gcsecsey can you try to it on your end to confirm, please?

My steps were:

  1. Download the .dmg from buildkite
  2. Install the app on my Mac
  3. Start Studio
  4. Click on Studio > Install CLI
  5. Try the studio commands like studio -h

Copy link
Contributor

@gcsecsey gcsecsey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gcsecsey could you test again please? I pushed some changes from trunk and I could not replicate the issue. Can you confirm it was fixed?

I cleared node_modules and did a fresh install, but I'm still getting the same issue on the latest 3c0b506 version. I'm seeing the same error a bit later in the Blueprint installation process:

[playground-cli] Running the Blueprint...
Activating woocommerce-payments – 87%Sentry Logger [log]: Captured error event `Timeout waiting for response to message 0`
Sentry Logger [error]: Transport disabled
Error occurred in handler for 'startServer': Error: Timeout waiting for response to message 0
    at Timeout._onTimeout (/Users/gcsecsey/a8c-projects/studio/dist/main/index.js:13002:18)
    at listOnTimeout (node:internal/timers:588:17)
    at process.processTimers (node:internal/timers:523:7)
Stopping server with ID 202af4a9-5d07-49ba-bfa6-67edc7c3a910

I suspect it might be something related to my environment though, if others can't reproduce it. 🤔 I'll try looking into this more separately.

The Studio CLI returns a warning/error message [0922/160239.105499:ERROR:node_main.cc(142)] Node.js environment variables are disabled because this process is invoked by other apps.

I also tested listing sites and previews using the CLI but couldn't reproduce this anymore. 👍

Image

@epeicher @gcsecsey @sejas would you all agree to take this approach? That way we can split different issues and avoid me being the blocker.

I agree too, approving it as I think the latest findings are not blockers and can be addressed separately if needed. 👍 🚢

@bcotrim bcotrim merged commit 6128d17 into trunk Sep 23, 2025
12 checks passed
@bcotrim bcotrim deleted the chore/vite_build branch September 23, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants