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

An unhandled exception occurred: Cannot find module '@angular-architects/module-federation/webpack' #24760

Closed
1 task done
molekola-io opened this issue Jan 5, 2024 · 3 comments

Comments

@molekola-io
Copy link

molekola-io commented Jan 5, 2024

Overview of the issue

./gradlew

Configure project :
The 'sonarqube' task depends on compile tasks. This behavior is now deprecated and will be removed in version 5.x. To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' and make sure your project is compiled, before analysis has started.
The 'sonar' task depends on compile tasks. This behavior is now deprecated and will be removed in version 5.x. To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' and make sure your project is compiled, before analysis has started.

Task :npmInstall

flow@0.0.1-SNAPSHOT prepare
husky install

husky - Git hooks installed

up to date, audited 2325 packages in 12s

336 packages are looking for funding
run npm fund for details

18 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
npm audit fix --force

Run npm audit for details.

Task :webapp

flow@0.0.1-SNAPSHOT webapp:build
npm run clean-www && npm run webapp:build:dev

flow@0.0.1-SNAPSHOT clean-www
rimraf build/resources/main/static/

flow@0.0.1-SNAPSHOT webapp:build:dev
ng build --configuration development

  • Generating browser application bundles (phase: setup)...
    An unhandled exception occurred: Cannot find module '@angular-architects/module-federation/webpack'
    Require stack:
  • /myproject/webpack/webpack.microfrontend.js
  • /myproject/webpack/webpack.custom.js
  • /myproject/node_modules/@angular-builders/custom-webpack/dist/utils.js
  • /myproject/node_modules/@angular-builders/custom-webpack/dist/custom-webpack-builder.js
  • /myproject/node_modules/@angular-builders/custom-webpack/dist/transform-factories.js
  • /myproject/node_modules/@angular-builders/custom-webpack/dist/browser/index.js
  • /myproject/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
  • /myproject/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
  • /myproject/node_modules/@angular/cli/src/command-builder/architect-base-command-module.js
  • /myproject/node_modules/@angular/cli/src/command-builder/architect-command-module.js
  • /myproject/node_modules/@angular/cli/src/commands/build/cli.js
  • /myproject/node_modules/@angular/cli/src/commands/command-config.js
  • /myproject/node_modules/@angular/cli/src/command-builder/command-runner.js
  • /myproject/node_modules/@angular/cli/lib/cli/index.js
  • /myproject/node_modules/@angular/cli/lib/init.js
    See "/private/var/folders/57/0tbtl1_12s3gyr3gl6z7zh_c0000gn/T/ng-G8RvkR/angular-errors.log" for further details.

Task :webapp FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':webapp'.

Process 'command '/myproject/.gradle/npm/npm-v10.2.4/bin/npm'' finished with non-zero exit value 127

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 41s
7 actionable tasks: 5 executed, 2 up-to-date##### Motivation for or Use Case

Reproduce the error

I run the jhipster command and after the generation complete, i registered the reported error

Related issues

I didn't find any related issues

Suggest a Fix

I don't know how to fix, is my first time with JHipster

JHipster Version(s)

JHIpster 8.1.0

JHipster configuration

jhipster info
WARNING! Since JHipster v8, the jhipster command will not use the locally installed generator-jhipster.
If you want to execute the locally installed generator-jhipster, run: npx jhipster
(node:24463) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)

    ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
    ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
    ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝

██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
https://www.jhipster.tech
Welcome to JHipster v8.1.0

Welcome to the JHipster Information Sub-Generator

flow@0.0.1-SNAPSHOT /Users/carmelogurgone/dev/molekola/molekola-flow
└── generator-jhipster@8.1.0
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "microservice",
    "authenticationType": "jwt",
    "baseName": "flow",
    "buildTool": "gradle",
    "cacheProvider": "hazelcast",
    "clientFramework": "angular",
    "clientTestFrameworks": [
      "cypress"
    ],
    "clientTheme": "quartz",
    "clientThemeVariant": "primary",
    "creationTimestamp": 1704475672912,
    "cypressAudit": true,
    "cypressCoverage": true,
    "databaseType": "sql",
    "devDatabaseType": "mysql",
    "devServerPort": 4200,
    "enableGradleEnterprise": null,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [],
    "feignClient": true,
    "gradleEnterpriseHost": null,
    "jhipsterVersion": "8.1.0",
    "languages": [
      "it",
      "en"
    ],
    "messageBroker": false,
    "microfrontend": null,
    "microfrontends": [],
    "nativeLanguage": "it",
    "packageName": "com.molekola.flow",
    "prodDatabaseType": "mysql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": "8085",
    "serverSideOptions": [],
    "serviceDiscoveryType": "consul",
    "testFrameworks": [
      "cypress"
    ],
    "websocket": false,
    "withAdminUi": true
  }
}
Environment and Tools

openjdk version "21.0.1" 2023-10-17
OpenJDK Runtime Environment Homebrew (build 21.0.1)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.1, mixed mode, sharing)

git version 2.39.3 (Apple Git-145)

node: v21.2.0
npm: 10.2.3

Docker version 24.0.6, build ed223bc

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

Mac os x Sonoma 14

  • Checking this box is mandatory (this is just to show you read everything)
@molekola-io
Copy link
Author

molekola-io commented Jan 5, 2024

An update:
I completely rebuild the application, after switching to the node LTS version: 20.10.0, but the error remains. This is the angular error:

[error] Error: Cannot find module '@angular-architects/module-federation/webpack'
Require stack:
- /myproject/webpack/webpack.microfrontend.js
- /myproject/webpack/webpack.custom.js
- /myproject/node_modules/@angular-builders/custom-webpack/dist/utils.js
- /myproject/node_modules/@angular-builders/custom-webpack/dist/custom-webpack-builder.js
- /myproject/node_modules/@angular-builders/custom-webpack/dist/transform-factories.js
- /myproject/node_modules/@angular-builders/custom-webpack/dist/browser/index.js
- /myproject/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- /myproject/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/index.js
- /myproject/node_modules/@angular/cli/src/command-builder/architect-base-command-module.js
- /myproject/node_modules/@angular/cli/src/command-builder/architect-command-module.js
- /myproject/node_modules/@angular/cli/src/commands/build/cli.js
- /myproject/node_modules/@angular/cli/src/commands/command-config.js
- /myproject/node_modules/@angular/cli/src/command-builder/command-runner.js
- /myproject/node_modules/@angular/cli/lib/cli/index.js
- /myproject/node_modules/@angular/cli/lib/init.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/myproject/webpack/webpack.microfrontend.js:1:40)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)

@mraible
Copy link
Contributor

mraible commented Jan 5, 2024

Duplicate of #24745. See PR that fixes it at #24747.

@mraible mraible closed this as completed Jan 5, 2024
@molekola-io
Copy link
Author

Thanks and sorry for the duplication!

@deepu105 deepu105 added this to the 8.2.0 milestone Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants