Closed vishalgvk closed 10 months ago
--workspaces
won’t work correctly without --monorepository
.
--workspaces
uses npm workspaces that hoist packages to the root.
package-lock.json at workspaces (microservices) will be broken if you try to mix.
In that case we should add a scripts folder or use shells scripts instead of npm scripts. We need to test if each microservice builds standalone.
Thanks for your reply @mshima
Now I understand that I have to combinedly include --monorepository
and --workspaces
But the issue persists even if I omit both of them i.e. creating a JHipster project by executing only:
jhipster jdl microservices.jdl
Thanks for your reply @mshima Now I understand that I have to combinedly include
--monorepository
and--workspaces
But the issue persists even if I omit both of them i.e. creating a JHipster project by executing only:
jhipster jdl microservices.jdl
Looks like --workspaces
is enabled by default. It shouldn't.
Microservice with angular microfrontend is missing a dependency.
Overview of the issue
When a JHipster project is being created from a JDL file, the generated gateway works fine but build fails for microservice apps stating: Cannot find module '@angular-architects/module-federation/webpack'
Reproduce the error
Source JDL: jdlFileContent.txt JDL file in .txt format Use:
jhipster jdl microservices.jdl --workspaces
to create JHipster project After starting keycloak and Consul, start gateway usingmvnw
-> works fine Then start microservices apps (store/blog) usingmvnw
-> build fails. build failure screenshotSuggest a Fix
I tried multiple ways and found that creating JHipster project with
jhipster jdl microservices.jdl --monorepository --workspaces
resolves the above issue.Including
--monorepository
always in live projects isn't recommended (as we do not prefer common Git repo for all the apps). Linked stackoverflow questionBrief config
JHipster - v8.1.0 Node - v18.19.0 Java - v17 NPM - v9.8.1
JHipster configuration
.yo-rc.json file
.yo-rc.json file for gateway
.yo-rc.json file for blog
.yo-rc.json file for store
Environment and Tools
java version "17.0.9" 2023-10-17 LTS Java(TM) SE Runtime Environment (build 17.0.9+11-LTS-201) Java HotSpot(TM) 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing)
git version 2.40.0.windows.1
node: v18.19.0 npm: 9.8.1
Docker version 24.0.7, build afdd53b
Browsers and Operating System
Google Chrome v120.0.6099.130 Windows 11 v23H2