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

Query params in remoteEntry URL are not taken into account #30602

Open
4 tasks
NivruthaB opened this issue Apr 3, 2025 · 0 comments · May be fixed by #30615
Open
4 tasks

Query params in remoteEntry URL are not taken into account #30602

NivruthaB opened this issue Apr 3, 2025 · 0 comments · May be fixed by #30615
Assignees
Labels
scope: module federation Issues related to module federation support type: bug

Comments

@NivruthaB
Copy link

Current Behavior

We have a dynamic module module federation setup in our angular nx monorepo.

The host application sets the following remoteDefinitions using setRemoteDefinitions:

{
    'sample-app': 'http://localhost:4201/remoteEntry.mjs?version=1234',
    'sample-app-2': 'http://localhost:4202/remoteEntry.mjs?version=1234'
}

When we load the remote module using loadRemoteModule method, the network request is set to 'http://localhost:4201/remoteEntry.mjs?version=1234/remoteEntry.mjs'

This is because of what we have here:

if (!remoteUrl.endsWith('.mjs') && !remoteUrl.endsWith('.js')) {

If the URL does not end in .mjs or .js, we add the default 'remoteEntry.mjs' keyword. But, the query params are not considered.

Expected Behavior

Query params should be considered and the request should go to 'http://localthost:4201/remoteEntry.mjs?version=1234' since the version param is important for cache busting.

GitHub Repo

No response

Steps to Reproduce

Repro steps are mentioned in the current behaviour section.

Nx Report

Node           : 20.17.0
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.8.2

nx (global)            : 20.1.4
nx                     : 20.3.1
@nx/js                 : 20.3.1
@nx/jest               : 20.3.1
@nx/eslint             : 20.3.1
@nx/workspace          : 20.3.1
@nx/angular            : 20.3.1
@nx/cypress            : 20.3.1
@nx/devkit             : 20.3.1
@nx/eslint-plugin      : 20.3.1
@nx/module-federation  : 20.3.1
@nx/plugin             : 20.3.1
@nx/web                : 20.3.1
@nx/webpack            : 20.3.1
typescript             : 5.5.4
---------------------------------------
Registered Plugins:
@nx/cypress/plugin
@nx/eslint/plugin
@nx/jest/plugin
---------------------------------------
Community plugins:
@ngrx/effects        : 18.0.2
@ngrx/operators      : 18.0.1
@ngrx/router-store   : 18.0.2
@ngrx/store          : 18.0.2
@ngrx/store-devtools : 18.0.2
ngx-build-plus       : 18.0.0
---------------------------------------
Local workspace plugins:
         @mfe/workspace-plugin
         mfe

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@NivruthaB NivruthaB changed the title Query params in remoteEntry URl are not taken into account Query params in remoteEntry URL are not taken into account Apr 3, 2025
ndcunningham added a commit that referenced this issue Apr 4, 2025
ndcunningham added a commit that referenced this issue Apr 4, 2025
ndcunningham added a commit that referenced this issue Apr 5, 2025
@FrozenPandaz FrozenPandaz added the scope: module federation Issues related to module federation support label Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: module federation Issues related to module federation support type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants