Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Upgrade Angular Gateway to use Webpack 5 #1

Closed
wants to merge 2 commits into from
Closed

Conversation

mraible
Copy link
Owner

@mraible mraible commented May 31, 2020

Currently fails with:

(node:56050) UnhandledPromiseRejectionWarning: Error: NormalModuleFactory.beforeResolve is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created.
    at /Users/mraible/microapps/gateway/node_modules/webpack/lib/NormalModuleFactory.js:543:11
    at eval (eval at create (/Users/mraible/microapps/gateway/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
    at runNextTicks (internal/process/task_queues.js:62:5)
    at processImmediate (internal/timers.js:429:9)

I believe this might be because of an incompatibility of @ngtools/webpack with Webpack 5. See https://stackoverflow.com/questions/61612636/mode-development-error-normalmodulefactory-beforeresolve-is-no-longer-a-water for more information.

Related: angular/angular-cli#17556

@mraible
Copy link
Owner Author

mraible commented Jun 26, 2020

After upgrading to Angular 10, this is failing with the following error:

ℹ 「wds」: Project is running at http://localhost:9060/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from ./target/classes/static/
ℹ 「wds」: 404s will fallback to /index.html
(node:96379) UnhandledPromiseRejectionWarning: Error: NormalModuleFactory.beforeResolve is no longer a waterfall hook, but a bailing hook instead. Do not return the passed object, but modify it instead. Returning false will ignore the request and results in no module created.
    at /Users/mraible/dev/mf-angular/gateway/node_modules/webpack/lib/NormalModuleFactory.js:572:11
    at eval (eval at create (/Users/mraible/dev/mf-angular/gateway/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
    at runNextTicks (internal/process/task_queues.js:62:5)
    at processImmediate (internal/timers.js:429:9)
(node:96379) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

Any ideas @deepu105 @sendilkumarn?

@mraible
Copy link
Owner Author

mraible commented Jun 26, 2020

When I try to run the project with Maven, I get a different error:

[INFO] > gateway@0.0.1-SNAPSHOT webpack /Users/mraible/dev/mf-angular/gateway
[INFO] > node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js "--config" "webpack/webpack.dev.js" "--env.stats=minimal"
[INFO]
[INFO] Webpack: Starting ...
[INFO] /Users/mraible/dev/mf-angular/gateway/node_modules/webpack-cli/bin/cli.js:141
[INFO] 				outputOptions = statsPresetToOptions(outputOptions);
[INFO] 				                ^
[INFO]
[INFO] TypeError: statsPresetToOptions is not a function
[INFO]     at processOptions (/Users/mraible/dev/mf-angular/gateway/node_modules/webpack-cli/bin/cli.js:141:21)
[INFO]     at /Users/mraible/dev/mf-angular/gateway/node_modules/webpack-cli/bin/cli.js:364:3

@deepu105
Copy link

deepu105 commented Jun 26, 2020

Its been quite long since I worked with Angular so not much that I could think of, unfortunately :(
Ya but does seem like webpack version incompatibility

@mraible
Copy link
Owner Author

mraible commented Jun 27, 2020

That's cool @deepu105. Maybe @vishal423 can help?

@vishal423
Copy link

sorry, I haven't yet looked into the webpack v5. Above errors seems to be plugins incompatibility with the next webpack version and don't think we can do much over here.

@deepu105
Copy link

deepu105 commented Jun 27, 2020 via email

@mraible
Copy link
Owner Author

mraible commented Jun 27, 2020 via email

@mraible mraible closed this Jun 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants