wpengine / faustjs

Faust.js™ - The Headless WordPress Framework
https://faustjs.org
Other
1.44k stars 134 forks source link

Bug: "faust blockset" fails with the following error: TypeError: glob is not a function #1966

Closed diegoavalon closed 2 weeks ago

diegoavalon commented 1 month ago

Description

When one attempts to sync local blocks to WordPress using the cli command faust blockset from @faustwp/cli package we get a dependency issue with the fetchBlockFiles() step.

Steps to reproduce

  1. Clone @faustwp/block-support-example
  2. Execute blockset script from package.json

Additional context

Error output

"faust blockset" failed with the following error: TypeError: glob is not a function at /Users/davalon/Projects/eni-nextjs-builder/node_modules/.pnpm/glob-promise@6.0.7_glob@10.4.5/node_modules/glob-promise/lib/index.js:5:5 at new Promise (<anonymous>) at promise (/Users/davalon/Projects/eni-nextjs-builder/node_modules/.pnpm/glob-promise@6.0.7_glob@10.4.5/node_modules/glob-promise/lib/index.js:4:10) at fetchBlockFiles (file:///Users/davalon/Projects/eni-nextjs-builder/node_modules/.pnpm/@faustwp+cli@3.1.0_encoding@0.1.13_webpack-dev-server@4.15.2_webpack-cli@5.1.4_webpack@5.95.0__webpack@5.95.0/node_modules/@faustwp/cli/dist/blockset.js:59:12) at blockset (file:///Users/davalon/Projects/eni-nextjs-builder/node_modules/.pnpm/@faustwp+cli@3.1.0_encoding@0.1.13_webpack-dev-server@4.15.2_webpack-cli@5.1.4_webpack@5.95.0__webpack@5.95.0/node_modules/@faustwp/cli/dist/blockset.js:198:29) at async file:///Users/davalon/Projects/eni-nextjs-builder/node_modules/.pnpm/@faustwp+cli@3.1.0_encoding@0.1.13_webpack-dev-server@4.15.2_webpack-cli@5.1.4_webpack@5.95.0__webpack@5.95.0/node_modules/@faustwp/cli/dist/index.js:56:13

The recommended fix is to use the glob package directly for Promise support instead of the glob-promise wrapper.

[!IMPORTANT] Glob has native Promise support as of v9.0.0, please use it directly. I will not issue a deprecation notice on this package, because I can't deal with the volume of angry tickets that will follow.

@faustwp/core Version

3.1.0

@faustwp/cli Version

3.1.0

FaustWP Plugin Version

latest

WordPress Version

latest

Additional environment details

No response

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

diegoavalon commented 1 month ago

PR fix -> 1967