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

PUBLIC_PATH support is not working anymore after react router v6 upgrade #1207

Closed
arslanashraf7 opened this issue Oct 12, 2023 · 4 comments
Closed

Comments

@arslanashraf7
Copy link
Contributor

arslanashraf7 commented Oct 12, 2023

Context:

In the past, The learning MFE used to support subdirectory paths i.e. PUBLIC_PATH. This helps the deployment of learning MFE in subdirectories and accessing it through an exposed PUBLIC_PATH.

Example

Suppose we have a use case where we want to access Learning MFE from a subdirectory on a path e.g. /learn instead of /. To do this in the past, we would add a config variable i.e. PUBLIC_PATH='/learn/' in .env.development (In case of local instance). Once done the learning MFE can be accessed at localhost:2000/learn/course/....

Issue

It looks like after feat: upgrade react router to v6 the PUBLIC_PATH is not working anymore. This could probably be because of some missing configurations in the new ReactRouter version (v6) to support this.

OR

A possible solution is that we have defined routes like HOME: '/course/:courseId/home', Which would not care if there is any PUBLIC_PATH defined. We should probably refactor these to use the PUBLIC_PATH. A reference for how this can be done can be seen in Discussions MFE.

@arbrandes
Copy link

This was fixed in master by #1209. What we're missing now is a backport.

@arslanashraf7
Copy link
Contributor Author

This was fixed in master by #1209. What we're missing now is a backport.

Great. @arbrandes Thanks!

@arbrandes
Copy link

This is the backport, for the record: #1210

@arbrandes
Copy link

Looks like we've been done here for a while! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants