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

Remote entry tuples not supported? #12658

Closed
teonapster opened this issue Oct 17, 2022 · 1 comment · Fixed by #12691
Closed

Remote entry tuples not supported? #12658

teonapster opened this issue Oct 17, 2022 · 1 comment · Fixed by #12691
Assignees
Labels
outdated scope: angular Issues related to Angular support in Nx scope: react Issues related to React support for Nx type: bug

Comments

@teonapster
Copy link

teonapster commented Oct 17, 2022

Current Behavior

According to this PR i should be able to use @nrwl/angular/module-federation/withModuleFederation with the following config (notice the remote tuples):

module.exports = {
  name: 'shell',
  remotes: [
    ['app1', 'http://localhost:4201/entryPoint.js'],
    ['app2', 'http://localhost:4202/entryPoint.mjs'],
  ],
};

But for some reason when i am trying to build my app with the config above, i get this error:
Invalid static remotes configured
So, when it comes to remotes value, it seems that only string array is allowed instead of tuples. Any idea how can i achive dynamic remote entry filenames?

Expected Behavior

From what i understand from the PR i tagged above, the expected behavior is that i can provide custom remoteEntry URL for each one of my remote MFEs.

Steps to Reproduce

Just try using the config above with the latest nrwl version.

This issue can't be reproduced in nx-examples because there is not such a config in there.

Failure Logs

nx run shell:serve:development
 >  NX   Invalid static remotes configured in "/home/myuser/projects/MyProj/apps/shell/module-federation.config.js": app1,http://localhost:4201, app2,http://localhost:4202.
Error: Invalid static remotes configured in "/home/myuser/projects/MyProj/apps/shell/module-federation.config.js": app1,http://localhost:4201, app2,http://localhost:4202.
    at getStaticRemotes (/home/myuser/projects/MyProj/node_modules/@nrwl/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js:53:15)

Environment

Result of nx report


   Node : 14.18.0
   OS   : linux x64
   yarn : 1.22.5
   
   nx : 14.8.4
   @nrwl/angular : 14.8.4
   @nrwl/cypress : 14.8.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.8.4
   @nrwl/esbuild : Not Found
   @nrwl/eslint-plugin-nx : 14.8.4
   @nrwl/expo : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 14.8.4
   @nrwl/js : 14.8.4
   @nrwl/linter : 14.8.4
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 14.8.4
   @nrwl/react-native : Not Found
   @nrwl/rollup : 14.8.4
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.8.4
   @nrwl/web : 14.8.4
   @nrwl/webpack : 14.8.4
   @nrwl/workspace : 14.8.4
   typescript : 4.8.4
   ---------------------------------------
   Local workspace plugins:
   ---------------------------------------
   Community plugins:

Done in 0.48s.

Thanks in advance

@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 21, 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 scope: react Issues related to React support for Nx type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants