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

TypeError for missing callback function when closing out of --watch mode #418

Open
1 task done
marcoluzi opened this issue Aug 6, 2024 · 0 comments
Open
1 task done

Comments

@marcoluzi
Copy link
Contributor

marcoluzi commented Aug 6, 2024

Describe the bug

When closing out of yarn 10up-toolkit build --watch using ctrl + c the following error is displayed:

 closing watch compilation


/Users/marcoluzi/Documents/toolkit-test/node_modules/webpack/lib/HookWebpackError.js:68                                                                                                                                                                                                                             
                callback(null, result);
                ^

TypeError: callback is not a function
    at /Users/marcoluzi/Documents/toolkit-test/node_modules/webpack/lib/HookWebpackError.js:68:3
    at Hook.eval [as callAsync] (eval at create (/Users/marcoluzi/Documents/toolkit-test/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:23:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/marcoluzi/Documents/toolkit-test/node_modules/tapable/lib/Hook.js:18:14)
    at Cache.shutdown (/Users/marcoluzi/Documents/toolkit-test/node_modules/webpack/lib/Cache.js:156:23)
    at /Users/marcoluzi/Documents/toolkit-test/node_modules/webpack/lib/Compiler.js:1378:15
    at Hook.eval [as callAsync] (eval at create (/Users/marcoluzi/Documents/toolkit-test/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/marcoluzi/Documents/toolkit-test/node_modules/tapable/lib/Hook.js:18:14)
    at Compiler.close (/Users/marcoluzi/Documents/toolkit-test/node_modules/webpack/lib/Compiler.js:1371:23)
    at /Users/marcoluzi/Documents/toolkit-test/node_modules/webpack/lib/Compiler.js:1367:10
    at shutdown (/Users/marcoluzi/Documents/toolkit-test/node_modules/webpack/lib/Watching.js:484:38)

Node.js v18.19.0

Hitting ctrl + c a second time will eventually close out of watch mode.

The bug started occuring in the Toolkit version 6.2.0-next.4, most likely in the commit dcc09bb .

Steps to Reproduce

Tested in a seperate folder without any other dependencies and in two wordpress themes.

  1. yarn add -D 10up-toolkit @10up/babel-preset-default
  2. yarn 10up-toolkit build --watch
  3. ctrl + c

Screenshots, screen recording, code snippet

No response

Environment information

  • Device: MacBook
  • OS: macOS 14.5
  • Node Version: v18 and v20
  • Yarn Version: v1.22.22 and v4.4.0

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
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

No branches or pull requests

1 participant