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

wp-scripts build fails on Linux when yarn -2 init on Windows #38078

Closed
jonshipman opened this issue Jan 19, 2022 · 7 comments
Closed

wp-scripts build fails on Linux when yarn -2 init on Windows #38078

jonshipman opened this issue Jan 19, 2022 · 7 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Tool] WP Scripts /packages/scripts

Comments

@jonshipman
Copy link

Description

Running a wp-scripts build with custom in points and output-path results in a silent fail. At the very least, a error should be logged in the console or, at best, the build should complete.

This occurs under Linux when the project was initialized on Windows (node 16.2, yarn 3.1.1). Causes pipelines to fail and moving projects across systems an issue.

So far, all attempts to install + build in Windows works. Cloning a repo down, installing, then building under Ubuntu 20.04 and Centos 7 results in a silent fail. Have tried node 16.2 and 16.13.2.

Running yarn set version classic under Linux will allow the build to succeed as normal.

Step-by-step reproduction instructions

I have pulled an existing project and minimized the src to the smallest possible. I have kept the dependencies.

URL: https://github.com/jonshipman/miniature-barnacle

Windows (specifically 11, but I don't see why 10 shouldn't also work)

  1. git clone https://github.com/jonshipman/miniature-barnacle.git (I used minGit)
  2. cd miniature-barnacle
  3. yarn install
  4. yarn build
  5. SUCCESS!

Linux (Ubuntu 20.04 in this scenerio)

  1. git clone https://github.com/jonshipman/miniature-barnacle.git
  2. cd miniature-barnacle
  3. yarn install
  4. yarn build
  5. Silently fails without a stdout or stderr.

If you drop back down to yarn 1 (yarn set version classic) on Linux - it will build successfully. I have employed this in our pipelines to keep work going. However, yarn classic does take 2x-3x longer than yarn cherry. Would like to be able to DX the issue and get a fix out on our side.

  • Note: if you have not used Yarn Cherry, you need to enable corepack (corepack enable). If your Node version is <=16.10 you need to install corepack first npm install -g corepack.

Screenshots, screen recording, code snippet

yarn

Environment info

NodeJS v16.2 & v16.13.2
Yarn 3.1.1

Tested Linux distros:
Ubuntu 20.04, CentOS7

Tested Windows:
Windows 11 Pro - 10.0.22000 Build 22000

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@skorasaurus skorasaurus added [Tool] WP Scripts /packages/scripts Needs Technical Feedback Needs testing from a developer perspective. labels Jan 19, 2022
@gziolo
Copy link
Member

gziolo commented Jan 21, 2022

We plan to publish a new version of @wordpress/scripts with many packages updated related to webpack. Let’s see if that helps.

Actually you could test with the preview version by installing with;

yarn add @wordpress/scripts@next --dev

You might need to remove some of the devDependencies listed in package.json file in case they conflict with what @wordpress/scripts uses.

@jonshipman
Copy link
Author

Same issue present with 20.0.1-next.33ec3857e2.0.

@gziolo
Copy link
Member

gziolo commented Jan 27, 2022

Same issue present with 20.0.1-next.33ec3857e2.0.

There is a stable version v20.0.0 from today which has more changes applied. I guess, the issue will be still present though. We need to investigate that issue.

@jonshipman
Copy link
Author

From what I can gather, pnp worked from about 19.2.0. It was probably a coincidence, but I first noticed trouble around the mini-css-extract-plugin bug (#38004).

In case someone stumbles on this issue tracker, a quicker fix (than setting your version to classic) would be to swap your nodeLinker to "node-modules" as opposed to "pnp".

@gziolo gziolo added [Status] Needs More Info Follow-up required in order to be actionable. and removed Needs Technical Feedback Needs testing from a developer perspective. labels Feb 11, 2022
@gziolo
Copy link
Member

gziolo commented Feb 11, 2022

We published a new version of @wordpress/scripts v21.0.0 yesterday. I don't think we had anything that could help here, but I just wanted to let you know. If you would be able to locate the dependencies that cause the issue we can always upgrade them.

@github-actions
Copy link

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Feb 27, 2022
@gziolo
Copy link
Member

gziolo commented May 7, 2022

Closing as there isn’t much we can do at the moment but we can always reopen when there is new details about the issue.

@gziolo gziolo closed this as completed May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Tool] WP Scripts /packages/scripts
Projects
None yet
Development

No branches or pull requests

3 participants