Skip to content

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

Closed
@arslanashraf7

Description

@arslanashraf7

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions