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

Webpack 5 node builder warnings DEP_WEBPACK_WATCH_WITHOUT_CALLBACK, DEP_WEBPACK_MODULE_ERRORS #6856

Closed
Nightbr opened this issue Aug 26, 2021 · 4 comments
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: bug

Comments

@Nightbr
Copy link

Nightbr commented Aug 26, 2021

Hey,

thanks for this awesome project and to be ultra up-to-date with state-of-the-art technologies!!

I have some warnings with Webpack 5 in nestjs application.

Current Behavior

$ nx serve api                

> nx run api:serve 

>  NX  Using webpack 5. Reason: detected version 5 in node_modules/webpack/package.json

(node:33773) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument needs to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
(node:33773) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
chunk (runtime: main) main.js (main) 2.77 KiB [entry] [rendered]
webpack compiled successfully (fa3539c4b1c182c0bef6)
Debugger listening on ws://localhost:9229/b7e40b37-69a7-4989-b6fe-6ffaffd355f1
Debugger listening on ws://localhost:9229/b7e40b37-69a7-4989-b6fe-6ffaffd355f1
For help, see: https://nodejs.org/en/docs/inspector
Issues checking in progress...
[Nest] 33775   - 2021-08-26 10:18:25   [NestFactory] Starting Nest application...
[Nest] 33775   - 2021-08-26 10:18:25   [InstanceLoader] AppModule dependencies initialized +11ms
[Nest] 33775   - 2021-08-26 10:18:25   [RoutesResolver] AppController {/api}: +3ms
[Nest] 33775   - 2021-08-26 10:18:25   [RouterExplorer] Mapped {/api, GET} route +2ms
[Nest] 33775   - 2021-08-26 10:18:25   [NestApplication] Nest application successfully started +1ms
[Nest] 33775   - 2021-08-26 10:18:25   Listening at http://localhost:3333/api +2ms
No issues found.

Expected Behavior

We should not have warnings:

(node:33773) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument needs to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
(node:33773) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)

Steps to Reproduce

npx create-nx-workspace --preset=nest
npx : 48 installé(s) en 3.283s
✔ Workspace name (e.g., org name)     · NestTest
✔ Application name                    · api
✔ Use Nx Cloud? (It's free and doesn't require registration.) · No
cd nest-test/
npx nx g @nrwl/node:webpack5
nx serve api 

Failure Logs

> nx run api:serve 

>  NX  Using webpack 5. Reason: detected version 5 in node_modules/webpack/package.json

(node:33773) [DEP_WEBPACK_WATCH_WITHOUT_CALLBACK] DeprecationWarning: A 'callback' argument needs to be provided to the 'webpack(options, callback)' function when the 'watch' option is set. There is no way to handle the 'watch' option without a callback.
(node:33773) [DEP_WEBPACK_MODULE_ERRORS] DeprecationWarning: Module.errors was removed (use getErrors instead)
chunk (runtime: main) main.js (main) 2.77 KiB [entry] [rendered]
webpack compiled successfully (fa3539c4b1c182c0bef6)
Debugger listening on ws://localhost:9229/b7e40b37-69a7-4989-b6fe-6ffaffd355f1
Debugger listening on ws://localhost:9229/b7e40b37-69a7-4989-b6fe-6ffaffd355f1
For help, see: https://nodejs.org/en/docs/inspector
Issues checking in progress...
[Nest] 33775   - 2021-08-26 10:18:25   [NestFactory] Starting Nest application...
[Nest] 33775   - 2021-08-26 10:18:25   [InstanceLoader] AppModule dependencies initialized +11ms
[Nest] 33775   - 2021-08-26 10:18:25   [RoutesResolver] AppController {/api}: +3ms
[Nest] 33775   - 2021-08-26 10:18:25   [RouterExplorer] Mapped {/api, GET} route +2ms
[Nest] 33775   - 2021-08-26 10:18:25   [NestApplication] Nest application successfully started +1ms
[Nest] 33775   - 2021-08-26 10:18:25   Listening at http://localhost:3333/api +2ms
No issues found.

Environment

$ nx report

>  NX  Report complete - copy this into the issue template

  Node : 12.21.0
  OS   : darwin x64
  npm  : 6.14.11
  
  nx : Not Found
  @nrwl/angular : Not Found
  @nrwl/cli : 12.8.0
  @nrwl/cypress : Not Found
  @nrwl/devkit : 12.8.0
  @nrwl/eslint-plugin-nx : 12.8.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.8.0
  @nrwl/linter : 12.8.0
  @nrwl/nest : 12.8.0
  @nrwl/next : Not Found
  @nrwl/node : 12.8.0
  @nrwl/nx-cloud : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.8.0
  @nrwl/web : Not Found
  @nrwl/workspace : 12.8.0
  @nrwl/storybook : Not Found
  @nrwl/gatsby : Not Found
  typescript : 4.3.5

I also have this issue with in Linux.

Possible solution

For DEP_WEBPACK_WATCH_WITHOUT_CALLBACK it seems it is throw because we call webpack with --watch option with the config watch: true in the config. -> webpack/webpack-cli#1918

For DEP_WEBPACK_MODULE_ERRORS, it seems it is from ts-loader. I tried to upgraded to the latest ts-loader v9.2.5 but I still have the warning -> TypeStrong/ts-loader#1194

If you have any question or need any debug logs, feel free to ask ;)

Cheers

@FrozenPandaz FrozenPandaz added the scope: node Issues related to Node, Express, NestJS support for Nx label Aug 26, 2021
@eliellis
Copy link

Seeing the same thing here. Any updates on this?

Here's my nx report output for posterity:

>  NX  Report complete - copy this into the issue template

  Node : 14.17.3
  OS   : darwin x64
  npm  : 6.14.13
  
  nx : Not Found
  @nrwl/angular : Not Found
  @nrwl/cli : 12.10.0
  @nrwl/cypress : Not Found
  @nrwl/devkit : 12.10.0
  @nrwl/eslint-plugin-nx : 12.10.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.10.0
  @nrwl/linter : 12.10.0
  @nrwl/nest : 12.10.0
  @nrwl/next : Not Found
  @nrwl/node : 12.10.0
  @nrwl/nx-cloud : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.10.0
  @nrwl/web : Not Found
  @nrwl/workspace : 12.10.0
  @nrwl/storybook : Not Found
  @nrwl/gatsby : Not Found
  typescript : 4.4.4

@Nightbr
Copy link
Author

Nightbr commented Oct 22, 2021

Seems fixed in Nx 13.0, no more warning on my side 🎉

@github-actions
Copy link

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs.
If we missed this issue please reply to keep it active.
Thanks for being a part of the Nx community! 🙏

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: node Issues related to Node, Express, NestJS support for Nx stale type: bug
Projects
None yet
Development

No branches or pull requests

3 participants