Skip to content

Commit

Permalink
fix: append trailing slash to PUBLIC_PATH
Browse files Browse the repository at this point in the history
This reverts ae60b2d.  We depend
heavily on Webpack's `publicPath` for everything to work in MFEs that
are hosted in sub-paths.  This variable affects many things, including
URLs that are automatically generated for things like static assets or
lazily loaded chunks of code.  If the trailing slash is not appended to,
say, `/learning`, a React.lazy() will try to fetch this from Caddy, and
fail:

`/learning210.3f8d0b2a9dbf3b1f1e69.js`

While this can (and probably should) be dealt with in frontend-platform,
we do it here for now.
  • Loading branch information
arbrandes authored and regisb committed Dec 7, 2023
1 parent d0e1005 commit bda7db7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [Bugfix] Append trailing slash to PUBLIC_PATH, as its absence breaks some MFEs. (by @arbrandes)
2 changes: 1 addition & 1 deletion tutormfe/templates/mfe/build/mfe/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ EXPOSE {{ app['port'] }}

# Configuration needed at build time
ENV APP_ID={{ app_name }}
ENV PUBLIC_PATH='/{{ app_name }}'
ENV PUBLIC_PATH='/{{ app_name }}/'
# We could in theory point the mfe_config API directly to the LMS. But for that we would
# have to code the LMS url into the mfe image, and this configuration is user-dependent.
# So we point to a relative url that will be a proxy for the LMS.
Expand Down

0 comments on commit bda7db7

Please sign in to comment.