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

Errors during the build process #37123

Closed
carolinan opened this issue Dec 4, 2021 · 4 comments
Closed

Errors during the build process #37123

carolinan opened this issue Dec 4, 2021 · 4 comments
Labels
[Type] Build Tooling Issues or PRs related to build tooling [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@carolinan
Copy link
Contributor

Description

I am unable to build the plugin from trunk.
npm install -no errors reported
On npm run build:

Error 1:

> [email protected] build:package-types D:\wordpress-develop\src\wp-content\plugins\gutenberg
> node ./bin/packages/validate-typescript-version.js && tsc --build

Build Progress: [                              ] 0%blocks:
  assets by status 341 KiB [cached] 148 assets

  ERROR in unable to locate 'D:/wordpress-develop/src/wp-content/plugins/gutenberg/packages/block-library/build-style/*/style.css' glob

  ERROR in unable to locate 'D:/wordpress-develop/src/wp-content/plugins/gutenberg/packages/block-library/build-style/*/style-rtl.css' glob

  ERROR in unable to locate 'D:/wordpress-develop/src/wp-content/plugins/gutenberg/packages/block-library/build-style/*/editor.css' glob

  ERROR in unable to locate 'D:/wordpress-develop/src/wp-content/plugins/gutenberg/packages/block-library/build-style/*/editor-rtl.css' glob

  ERROR in unable to locate 'D:/wordpress-develop/src/wp-content/plugins/gutenberg/packages/block-library/build-style/*/theme.css' glob

  ERROR in unable to locate 'D:/wordpress-develop/src/wp-content/plugins/gutenberg/packages/block-library/build-style/*/theme-rtl.css' glob

  blocks (webpack 5.47.1) compiled with 6 errors in 978 ms

I wonder if this is related to the upgrade of fast-glob:
https://github.com/WordPress/gutenberg/pull/36260/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L172

If I revert fast-glob back to version 2.2.7, I do not have any build errors, but I am unsure of what other issues that may cause.
(I don't even know what a glob is...) I do not know how to troubleshoot it further, or if I need to open an issue here? https://github.com/mrmlnc/fast-glob/

Error 2:

packages:
  assets by status 15.2 KiB [cached] 110 assets
  ./packages/block-serialization-spec-parser/parser.js 47.2 KiB [built] [code generated]

  ERROR in a11y
  Module not found: Error: Can't resolve './packages/a11y' in 'D:\wordpress-develop\src\wp-content\plugins\gutenberg'

There are several packages that can't be resolved, I only copied the first message.

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

Environment info

Windows 10.
NPM 6.14.15.
Node v14.17.3.

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

@carolinan carolinan added the [Type] Help Request Help with setup, implementation, or "How do I?" questions. label Dec 4, 2021
@gziolo gziolo added the [Type] Build Tooling Issues or PRs related to build tooling label Dec 5, 2021
@t-hamano
Copy link
Contributor

t-hamano commented Dec 7, 2021

I am also a Windows user and have encountered the exact same symptoms.
I don't know the exact cause, but I think it is because the path separator is different between Windows and Mac OS.

The build succeeded by following the fast-glob documentation and replacing the path separator in the two files as shown below.

  • /bin/packages/build.js
  • /bin/packages/build-worker.js
const PACKAGES_DIR = path.resolve( __dirname, '../../packages' );

// to

const PACKAGES_DIR = path.resolve( __dirname, '../../packages' ).replace( /\\/g, '/' );

I think it is not enough to just modify these two since the PACKAGES_DIR constants are defined in various files, but I could not determine if it is appropriate to just modify all those constants.

Hopefully this information will help you fix it.

@t-hamano
Copy link
Contributor

t-hamano commented Dec 7, 2021

I looked into it, and this is a fix that is only needed for some tasks that use fast-glob.
So, I'd like to submit PR if these two fixes make it pass the local build and test.

@talldan
Copy link
Contributor

talldan commented Dec 8, 2021

In the changelog for fastglob 3:

Only forward-slashes in glob expression. Previously, we convert all slashes to the forward-slashes, which did not allow the use of escaping. See pattern syntax section in the README.md file.

So that might explain it.

@carolinan
Copy link
Contributor Author

This has been solved, so I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

4 participants