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

NX update migrations don't rename mfe.config in webpack configuration files #10271

Closed
caeb92 opened this issue May 12, 2022 · 3 comments
Closed
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx type: bug

Comments

@caeb92
Copy link

caeb92 commented May 12, 2022

Hello!! Im currently using angular with module federation using the flag federationType=dynamic, I made a update to fix issue 9861 in windows machines and work fine, but migrations are missing rename some file content.

Current Behavior

After update my project module-federation.config.js and webpack.config.js keep old references to mfe.config , serve project crash becouse can't find mfe.config file in Angular MFE host and remote projects.

Same issue in MacOS 12.3.1 and Windows 11 machines

Expected Behavior

NX may replace the reference for old name mfe.config to module-federation.config.js in webpack.config.js and webpack.prod.config.js configuration files in Angular MFE host and remote projects.

Steps to Reproduce

  • Upgrade NX workspace from version 13.10.2 to 14.1.5
  • Follow next steps after upgrade
  • Serve MFE Host with NX console

Failure Logs

nx run host-app:serve:development

Generating browser application bundles (phase: setup)...Cannot find module './mfe.config'
Require stack:
- root/proyect-name/apps/host-app/webpack.config.js
- root/proyect-name/node_modules/@nrwl/angular/src/builders/utilities/webpack.js
- root/proyect-name/node_modules/@nrwl/angular/src/builders/webpack-server/webpack-server.impl.js
- root/proyect-name/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js
- root/proyect-name/node_modules/@angular-devkit/architect/node/index.js
- root/proyect-name/node_modules/nx/src/adapter/ngcli-adapter.js
- root/proyect-name/node_modules/nx/src/command-line/run.js
- root/proyect-name/node_modules/nx/bin/run-executor.js

Environment

   Node : 14.15.5
   OS   : darwin x64
   npm  : 8.1.4
   
   nx : 14.1.5
   @nrwl/angular : 14.1.5
   @nrwl/cypress : 14.1.5
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.1.5
   @nrwl/eslint-plugin-nx : 14.1.5
   @nrwl/express : Not Found
   @nrwl/jest : 14.1.5
   @nrwl/js : 14.1.5
   @nrwl/linter : 14.1.5
   @nrwl/nest : 14.1.5
   @nrwl/next : Not Found
   @nrwl/node : 14.1.5
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.1.5
   @nrwl/web : Not Found
   @nrwl/workspace : 14.1.5
   typescript : 4.6.3
   rxjs : 7.5.5
   ---------------------------------------
   Community plugins:
@AgentEnder AgentEnder added the scope: angular Issues related to Angular support in Nx label May 12, 2022
@caeb92
Copy link
Author

caeb92 commented May 12, 2022

After upgrade and install dependencies works fine but I restart VSCode and run my host app, my web browser now is throwing 404 error can't find /assets/module-federation.manifest.json

The file main.ts of my host project is calling the file as module-federation.manifest.json not module-federation.config.json

import { setRemoteDefinitions } from '@nrwl/angular/mfe';

fetch('/assets/module-federation.manifest.json')
  .then((res) => res.json())
  .then((definitions) => setRemoteDefinitions(definitions))
  .then(() => import('./bootstrap').catch((err) => console.error(err)));

I rename the reference in main.ts as module-federation.config.json, works fine

@Coly010
Copy link
Contributor

Coly010 commented Jun 6, 2022

I'm sorry you encountered this issue! As you have seen, it was straightforward to fix. I'm going to close this issue as there isn't anything we can do from an Nx side to address this.

Thanks for raising this !

@Coly010 Coly010 closed this as completed Jun 6, 2022
@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: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants