jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.5k stars 4.02k forks source link

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

Closed molekola-io closed 9 months ago

molekola-io commented 9 months ago
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

Task :webapp FAILED

FAILURE: Build failed with an exception.

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

molekola-io commented 9 months ago

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 commented 9 months ago

Duplicate of https://github.com/jhipster/generator-jhipster/issues/24745. See PR that fixes it at https://github.com/jhipster/generator-jhipster/pull/24747.

molekola-io commented 9 months ago

Thanks and sorry for the duplication!